Executing Scripts Using SuiteScript 2.1

You can use an account-level preference, Execute SuiteScript 2.x Server Scripts As, to specify that the 2.x value in the @NApiVersion JSDoc tag should represent SuiteScript 2.1 and not default to SuiteScript 2.0. With this preference, you can execute all of your SuiteScript 2.x scripts as SuiteScript 2.1 scripts without having to make any changes to any script. This preference lets you specify which version of SuiteScript the 2.x value maps to (SuiteScript 2.0 or SuiteScript 2.1). For more information about this preference, see Enabling SuiteScript 2.1 at the Account Level.

Currently, a value of 2.x for the @NApiVersion JSDoc tag will, by default, resolve to 2.0 when the script is uploaded and executed. This means that all scripts that include @NApiVersion 2.x are executed as SuiteScript 2.0 scripts. In a future release, this will change so that scripts annotated with 2.x will automatically execute as SuiteScript 2.1 scripts, by default. When this happens, account administrators will receive notifications that 2.x annotated scripts will begin executing as SuiteScript 2.1 scripts. Notifications will be sent to account administrators if there is at least one script in their account that is annotated with the @NApiVersion JSDoc tag value of 2.x.

There are two ways you can execute your scripts using SuiteScript 2.1:

For more information about the @NApiVersion JSDoc tag, see SuiteScript 2.x JSDoc Validation.

Related Topics

Differences Between SuiteScript 2.0 and SuiteScript 2.1
SuiteScript Versions
SuiteScript 2.1 Language Examples
SuiteScript 2.1

General Notices