Executing a Single Script Using SuiteScript 2.1
To execute a single script as a SuiteScript 2.1 script, you must annotate the script to explicitly use SuiteScript 2.1. This will let you execute a single script as a SuiteScript 2.1 script without affecting any other scripts in your account. This approach is useful if you want to use SuiteScript 2.1 features in only a few of your scripts. It is also useful if you are not ready to execute all SuiteScript 2.x annotated scripts in your account as SuiteScript 2.1 scripts.
To execute a single script using SuiteScript 2.1:
-
In your script file, include the following JSDoc comment block at the beginning of the file:
/** * @NApiVersion 2.1 */
-
Add other JSDoc tags (such as
@NScriptType
) as appropriate. For more information, see SuiteScript 2.x JSDoc Validation. -
Upload and deploy your script. Your script will be validated as a SuiteScript 2.1 script. For more information, see SuiteScript 2.x Entry Point Script Creation and Deployment.