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

  • Author
    Posts
  • #21714

    johngraham

    Anyone aware if it is possible to add a custom notice or banner similar "Warning This record may have duplicate" on a record (sales order, customer) based off of custom code?
    This is a cached copy. Click here to see the original post.

  • #21715

    david.smith

    SuiteScript 2.x module called N/ui/message module

    https://netsuite.custhelp.com/app/an…ail/a_id/49316

  • #21716

    CREECE

    You can. I did this with some code earlier.

    In my UE script on the record, I check a particular request param and show a banner like:

    Code:
    var fieldObj = form.addField('custpage_editunavailable', 'inlinehtml', ' ');
    fieldObj.setDefaultValue('<div id="div_alert"><div style="" class="uir-alert-box alert" width="100%" role="status">' +
    '<div class="icon alert"></div><div class="content"><div class="title">YOUR TITLE MESSAGE HERE</div>' +
    '<div class="descr">YOUR DESCRIPTION MESSAGE HERE</div></div></div></div>');
    fieldObj.setLayoutType('outsideabove', 'startrow');
    Looks like the below screenshot. Just change the class to be the one you want.

  • #21717

    michoel

    Another option for SS1.0 is to use the undocumented internal Netsuite function showAlertBox() in your client side code.

    Code:
    showAlertBox('alert_duplicate_record', 'Warning – This record may have duplicate', 'This record may have duplicates.', NLAlertDialog.TYPE_HIGH_PRIORITY);


    CREECE replied on 04/05/2017, 11:23 PM: Either way it is a bit shady I didn’t know about this method until now though thanks for the info!

  • #21718

    chanarbon

    I think CREECE 's solution should work really well. It is a better approach to use what we have on the APIs provided rather than using the functionalities that are not directly shown on the documentation to ensure that the codes logic will work even if there will be some changes in the UI components


    michoel replied on 04/05/2017, 05:16 PM: Note though that @creece’s solution also makes use of undocumented Netsuite CSS classes that are also subject to changes.

  • #21719

    johngraham

    Thanks for all the input. CREECE , I want to add this to a standard sales order and not a custom form. Any ideas?

  • #21720

    ERPExperts

    Originally posted by johngraham

    View Post

    Thanks for all the input. CREECE , I want to add this to a standard sales order and not a custom form. Any ideas?

    A Before Load UserEvent which adds a new field on the Page, and sets the default value to the previous post's value.

    Deploy this script then to the Sales Order Record Type.

  • #21721

    ERPExperts

    Originally posted by michoel

    View Post

    Another option for SS1.0 is to use the undocumented internal Netsuite function showAlertBox() in your client side code.

    Code:
    showAlertBox('alert_duplicate_record', 'Warning – This record may have duplicate', 'This record may have duplicates.', NLAlertDialog.TYPE_HIGH_PRIORITY);

    Ah I was looking for this! Thanks Michoel!

  • #21722

    johngraham

    Fantastic! Works as expected. Thanks again for everyone's help.

You must be logged in to reply to this topic.