Enabling SuiteScript 2.1 at the Account Level

When you use the @NApiVersion JSDoc tag in a script file, you can specify a value of 2.x or 2.0. The Execute SuiteScript 2.x Server Scripts As account-level preference lets you run all scripts with the @NApiVersion value set to 2.x as SuiteScript 2.1. Setting this preference to 2.1 applies to all scripts in your account that use the 2.x value.

The Execute SuiteScript 2.0 Server Scripts as SuiteScript 2.1 account level preference lets you run all scripts with the @NApiVersion value set to 2.0 as SuiteScript 2.1. These preferences are helpful if you want to test all of your 2.x or 2.0 scripts as SuiteScript 2.1 scripts without having to specifically annotate each script with the @NApiVersion JSDoc tag value of 2.1. By using these preferfences, you don't need to change any script files to switch the SuiteScript version they run as.

To enable SuiteScript 2.1 at the account level for 2.x scripts:

  1. Go to Setup > Company > Preferences > General Preferences.

  2. In the Execute SuiteScript 2.x Server Scripts As dropdown list, select 2.1.

    Execute SuiteScript 2.X Server Scripts setting set to 2.1.
  3. Click Save.

To enable SuiteScript 2.1 at the account level for 2.0 scripts:

  1. Go to Setup > Company > Preferences > General Preferences.

  2. Check the Execute SuiteScript 2.0 Server Scripts As SuiteScript 2.1 box.

  3. Click Save.

Important:

Only script types supported on SuiteScript 2.1 will run when the Execute SuiteScript 2.0 Server Scripts as SuiteScript 2.1 preference is enabled. Scripts not yet supported in 2.1 will not be affected by this preference.

When you use this account-level preference, you should understand how validation of the script occurs. If you have a SuiteScript annotated as @NApiVersion 2.x and you set the Execute SuiteScript 2.x Server Scripts As preference to 2.1, syntax of the script is validated as if the script was a SuiteScript 2.0 script. If you add syntax that is supported only in SuiteScript 2.1, you receive a syntax error when you upload the script file.

This approach is designed to ensure that SuiteScript 2.x and SuiteScript 2.0 scripts in your account continue to work even if the Execute SuiteScript 2.x Server Scripts As preference is changed from 2.1 back to 2.0. To test new SuiteScript 2.1 features and syntax, you should update the @NApiVersion JSDoc tag in your script files from 2.x to 2.1 explicitly. You can also upload new scripts as SuiteScript 2.1 scripts.

For more information about script versions, see the following topics.

Related Topics

General Notices