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.
SuiteScript 2.1 is now the standard scripting version. Update scripts that use SuiteScript 1.0 or the SuiteScript 2.0 or 2.x version annotations to SuiteScript 2.1 by the 2028.2 release to ensure continued compatibility. For more information, see Transitioning To SuiteScript 2.1.
-
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.