Posts

SuiteScript Best Practices

This section provides best practices for Suite Script optimization : -  Design your user event scripts to execute in under 5 seconds, Suitelets and Portlets to execute in under 10 seconds, and scheduled scripts in under 5 minutes. Use nlapiLookupField instead of nlapiLoadRecord for fetching body field values. Use nlapiSubmitField instead of nlapiSubmitRecord for updating body field values.  Use inline editable child custom records whenever your use case calls for batch processing of multiple related/child records. Use nlapiScheduleScript to schedule (asynchronously execute) long-running operations from user events and Suitelets. Avoid calls to nlapiGetOldRecord() in user event scripts unless absolutely required.  set your script log level to ERROR or EMERGENCY . Deploy scripts to run as admin only if absolutely necessary to minimize security risk and to eliminate performance overhead.