Tip 47 – STOP NetSuite standard popup for Amount change in Sales Order record using Suitescript???

If you have ever worked in NetSuite Sales Order record, you must have noticed below scenario:

Every time you change amount in ITEM Sublist, you see below popup confirm message, if below condition doesn’t satisfy:

New Amount != Rate * Quantity

This is NetSuite’s standard popup.

What if your client have the requirement to update the amount by their end users as part of their general Sales Order process.

Now let’s see how can we suppress this message, this is a frequent scenario for your client.

Here is the following sample code, that you can use for similar requirement.

You can save this piece if code for your reference, so that if you need to suppress any standard popup in NetSuite, you can use this as reference. You can use this code for any Netsuite warning popup for any field change. Remember, if you want to show certain warning on some field change but suppress for some, make sure you mention the field id in field change event before adding “window.confirm()….”.

You can refer to my previous tip for suppressing NetSuite standard popup on record leave/load.

Here is the link for reference: https://ashabarijena.wordpress.com/2024/02/19/netsuite-tip-46/

Tip 46 – Get rid of NetSuite standard popups on NetSuite record leave/reload using Suitescript

If you are a regular NetSuite user, you might have guessed what I am talking about. Is there anyone who have not got annoyed by those popup messages every time you make any change in some fields or you leave a record without saving.

Let’s discuss two real life scenarios:

Let’s say you have a client script that adds some parameters on the URL and you want to reload the page to perform some task depending on URL parameter. But you will notice, every time you reload the page, you will see the NetSuite standard popup as below.

Now as this popup is unnecessary, we can suppress this.

Here is the following sample code, that you can use for similar requirement.

In you client script, just before “window.location.href = url;” as fllows:

function YourCLientScriptFunctionName(){

//Add your code

//Below code avoids the standard NetSuite warning message on page leave/reload

if (window.onbeforeunload){
window.onbeforeunload=function() { null;};
};
window.location.href = url; //Reload the page

}

You can refer to my next tip for suppressing NetSuite standard popup on amount field change in Sales Order record.

Here is the link for reference: https://ashabarijena.wordpress.com/2024/02/19/netsuite-tip-47/