Posts

Showing posts from September, 2018

DIFFERENCE BETWEEN CLIENT SCRIPT SAVE FUNCTION AND USER EVENT BEFORE SUBMIT FUNCTION?

A lot of times validation is required on submit of a record and developers can get confused on whether to use client script save function or user event before submit function to perform the validation. The below points can be used to make an informed decision. TRIGGER POINT: Client script save is triggered only on create, edit and copy. User event before submit is triggered on create, edit, delete, xedit, approve, reject, cancel (SO, ER, Time Bill, PO & RMA only), pack, ship (IF), markcomplete (Call, Task), reassign (Case), editforecast (Opp, Estimate) Also user event before submit has a type parameter to check the trigger type. Client script save function doesn't have any parameter. To check the trigger type in client script, you will need a pageinit function as well which can be used to copy the type to a global variable which can be accessed on save. USER PERMISSION: A client script can triggered only based on the role permission of logged in user.  Hence, if

SOME FACTS ABOUT NETSUITE SCHEDULED SCRIPT

What are scheduled scripts? Scheduled scripts are Netsuite server side scripts used for processing large amount of data/records. What is the governance limit of scheduled scripts? 10000 units. How is a scheduled script executed? Scheduled script can be executed either manually from the script deployment page by clicking on save and execute or it can be executed from the scripts using scheduling api's or it can be scheduled to run at a specific time by defining it's scheduled in the deployment page. Is it possible to overcome 10000 units limit in scheduled script? Yes. This can be achieved in 1.0 script by first checking the remaining usage. If it is less than 200 or 100, you can set the recovery point using nlapiSetRecoveryPoint() and then yielding the script using the api nlapiYieldScript(). In 2.0, there is no option to yield script. You can place back the script in queue when remaining usage is less and pass the internal id of last processed record in the para