ALERT IN NETSUITE USING USER EVENT BEFORE LOAD SCRIPT
HOW TO THROW ALERT FROM USER EVENT BEFORE LOAD SCRIPT?
It is a well known fact that alert can be thrown from client script by directly using alert() method. But lot of times developer needs to use user event script as client script has several limitations like not being able to run as admin. It always runs the script using the logged in user’s role. Client script also doesn’t get triggered when you view a record. It gets triggered only on edit, create and copy.
Alert can be thrown from user event script by using a mix of html code with Netsuite API. So, first you will to create a custom field of type inline html. Label is not required for this field. This field can be created using form object in the before load function.
Then we can set an html alert in that field as default value. The code snippet is given below
function UE_BeforeLoad(type, form, request)
var field = form.addField(‘custpage_alertfield’ , ‘inlinehtml’);
contact us at:
Email : email@example.com