This topic contains 3 replies, has 0 voices, and was last updated by adityasrivalli 7 years, 8 months ago.

  • Author
    Posts
  • #5888

    adityasrivalli

    Need help to create a hyperlink in an alert box such as click

    Any ideas please
    This is a cached copy. Click here to see the original post.

  • #5889

    michoel

    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: “Click here“,
    });
    });
    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: “Click here“,
    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’);
    };

  • #5890

    Vesku1980

    var invurl = nlapiResolveURL(‘RECORD’,’invoice’,invid);

    var tranid = resultSet[i].getValue(‘tranid’);

    var content = ‘‘+tranid+’

  • #5891

    adityasrivalli

    Thank you Michoel…!

You must be logged in to reply to this topic.