SuiteScript 2.1
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.
You can use SuiteScript to extend and customize NetSuite, and search and process your NetSuite data. SuiteScript supports procedural logic for both client and server scripts, as well as debugging.
SuiteScript 2.1 is now the standard scripting version and can be used for server and client scripts. For server scripts, the Graal runtime engine supports ECMAScript 2023, which lets you use modern language capabilities and functions in your scripts. For client scripts, you can include functions and features supported by the ECMAScript version your browser uses.
SuiteScript 2.1 supports modern JavaScript features such as arrow functions, classes, destructuring, and spread and rest operators. For example, you can use the spread operator to combine properties from two objects into a new one.
This topic covers the following sections:
Working with SuiteScript 2.1
SuiteScript 2.1 supports several script types, including client scripts, user event scripts, scheduled scripts, and more. Using SuiteScript 2.1, you can create custom modules and custom pages, and you can script records and subrecords.
SuiteScript 2.1 provides AI-specific modules, including N/llm Module, N/documentCapture Module, and N/machineTranslation Module. You can use these modules to incorporate generative AI, document data extraction, and language translation into NetSuite customizations.
The SuiteScript 2.1 API Introduction topic explains how to use SuiteScript 2.1. It includes a Hello World sample, the script creation process, and developer resources.
For more information about working with SuiteScript 2.1, see the following topics:
Debugging and Compatibility
You can debug SuiteScript 2.1 server scripts with the 2.1 Script Debugger, which uses Chrome DevTools. For client scripts, use your browser's debugging tools. For more information about the 2.1 Script Debugger, see Debugging SuiteScript 2.1 Scripts.
Keep the following restrictions in mind:
-
Some SuiteScript 2.1 features are not fully supported in client scripts, such as for subrecords. For example, you may get an error if your client script is deployed for All Records, since that includes subrecords. In this case, if you need to deploy to All Records, update your 2.1 client script to use ES5.1 features instead of newer ECMAScript ones.
-
SuiteScript 2.1 client scripts are not currently supported in the Scriptable Cart. For more information about the Scriptable Cart, see Scriptable Cart and SuiteScript for Scriptable Cart.
To help you transition your scripts to SuiteScript 2.1, see Transitioning To SuiteScript 2.1.