A standard alert box in JavaScript cannot include a clickable hyperlink.
You have a couple of other options:
1) You can use the new SS2.0 N/ui/dialog module to create a popup box with HTML
Code:
require(['N/ui/dialog'], function(dialog) {
dialog.alert({
title: "Click on the link",
message: "<a href='" + nlapiResolveURL('TASKLINK', 'CARD_-10') + "' target='_blank'>Click here</a>",
});
});
2) In SuiteScript 1.0 you can use the Ext.js library directly to achieve the same result.
Code:
var message = ;
Ext.MessageBox.show({
title: 'Click on the link',
msg: "<a href='" + nlapiResolveURL('TASKLINK', 'CARD_-10') + "' target='_blank'>Click here</a>",
icon: Ext.MessageBox.INFO,
buttons: Ext.MessageBox.OK,
});
3) You can use any other 3rd party dialog library (such as jQuery UI) if you prefer
4) Use a built-in confirm() dialog, and redirect one of the buttons to the url
Code:
if (window.confirm('Click ok to open the link')) {
window.location = nlapiResolveURL('TASKLINK', 'CARD_-10');
};