SuiteScript Version Syntax and Preferences
The following table compares how you can use 2.0 or 2.1 syntax, set the @NApiVersion JSDoc tag, and choose the Execute SuiteScript 2.x Server Scripts As preference.
|
Syntax |
@ |
Execute SuiteScript 2.x Server Scripts As preference |
Upload the script file |
Create a script record |
Deploy the script |
Run the script |
|---|---|---|---|---|---|---|
|
2.0 |
2.0 |
2.0 |
Success |
Success |
Success. Script deployment is not affected by SuiteScript syntax, @NApiVersion value or preference setting. |
Success |
|
2.1 |
Success |
Success |
Success |
|||
|
2.1 |
2.0 |
Success |
Success |
Success |
||
|
2.1 |
Success |
Success |
Success |
|||
|
2.x |
2.0 |
Success |
Success |
Success |
||
|
2.1 |
Success |
Success |
Success |
|||
|
2.1 |
2.0 |
2.0 |
Syntax error |
The script file can't be uploaded, therefore, a script record can't be created. |
The script file can't be uploaded, therefore, it can't be executed. |
|
|
2.1 |
Syntax error |
The script file can't be uploaded, therefore, a script record can't be created. |
The script file can't be uploaded, therefore, it can't be executed. |
|||
|
2.1 |
2.0 |
Success |
Success |
Unsuccessful - type of error will vary |
||
|
2.1 |
Success |
Success |
Success |
|||
|
2.x |
2.0 |
Syntax error |
The script file can't be uploaded, therefore, a script record can't be created. |
The script file can't be uploaded, therefore, it can't be executed. |
||
|
2.1 |
Syntax error |
The script file can't be uploaded, therefore, a script record can't be created. |
The script file can't be uploaded, therefore, it can't be executed. |
You can check which version of SuiteScript is used to process your script by looking at the Execute As Version field on the script record. For more information, see Version Information in the Script Record.