runtime.executionContext
Execution contexts provide information about how a script is triggered to execute. For example, a script can be triggered in response to an action in the NetSuite application, or an action occurring in another context, such as a web services integration. You can use execution context filtering to ensure that your scripts are triggered only when necessary.
You can use the runtime.executionContext property to determine the execution context for a script and choose different logic depending on the context. Consider a script that applies to customer records and uses the beforeLoad(context) entry point. You may not want to execute this script when the entry point is triggered in response to CSV Import. To prevent the script from executing in this context, you can do the following:
if (runtime.executionContext === runtime.ContextType.CSV_IMPORT) {
return;
}
Type –> string (read-only)
Supported Script Types –> Client and server scripts
Module –> N/runtime Module