This topic contains 3 replies, has 0 voices, and was last updated by adityasrivalli 7 years, 5 months ago.
-
AuthorPosts
-
adityasrivalli- Contributions: 0
- Level 1
- ☆
Need help to create a hyperlink in an alert box such as <a href="nlapiResolveURL()">click</a>
Any ideas please
This is a cached copy. Click here to see the original post. -
michoel- Contributions: 0
- Level 1
- ☆
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 prefer4) 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');
}; -
Vesku1980- Contributions: 0
- Level 1
- ☆
var invurl = nlapiResolveURL('RECORD','invoice',invid);
var tranid = resultSet[i].getValue('tranid');
var content = '<a href="'+invurl+'">'+tranid+'</a>'
-
adityasrivalli- Contributions: 0
- Level 1
- ☆
Thank you Michoel…!
-
AuthorPosts
You must be logged in to reply to this topic.