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

  • Author
    Posts
  • #5828

    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.

  • #5829

    david.smith

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

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

  • #5830

    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(‘

    ‘ +
    YOUR TITLE MESSAGE HERE

    ‘ +

    YOUR DESCRIPTION MESSAGE HERE

    ‘);
    fieldObj.setLayoutType(‘outsideabove’, ‘startrow’);
    Looks like the below screenshot. Just change the class to be the one you want.

  • #5831

    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!

  • #5832

    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.

  • #5833

    johngraham

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

  • #5834

    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.

  • #5835

    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!

  • #5836

    johngraham

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

You must be logged in to reply to this topic.