SuiteScript Statement and Instruction Limits
NetSuite enforces execution limits to help prevent scripts from running indefinitely or consuming excessive resources. If a script exceeds these limits, NetSuite throws an error and terminates execution. This error varies depending on which script version is used.
-
For SuiteScript 1.0, 2.0, and 2.x scripts, the
SSS_INSTRUCTION_COUNT_EXCEEDEDerror is thrown based on the instruction count metric, which measures the number of low-level operations (instructions) executed by the script engine interpreter. The instruction count may vary depending on how JavaScript constructs are implemented internally. For example, a single JavaScript statement such asArray.sortmay correspond to a single operation in user code but multiple instructions within the engine.
-
For SuiteScript 2.1 scripts, the
SSS_STATEMENT_COUNT_EXCEEDEDerror is thrown based on statement metric in the script engine interpreter. This metric counts JavaScript-level statements executed, providing a higher-level measurement than the instruction count.
If you encounter these errors, you should examine all of the execution loops in your script to ensure that they contain either a terminating condition or a condition that can be met.