Entry Point Script Validation Guidelines
For an entry point script to be valid, its structure must meet certain requirements. If it doesn't meet all these requirements, you won't be able to create a script record for the script, and you won't be able to attach the script to a form. In some cases, you won't be able to upload the script file to the File Cabinet if it doesn't meet all requirements.
If a correctly formatted script is already attached to a custom form or has a script record, you can't edit and save changes to the script file that would introduce errors during validation.
For more information, see the following:
Entry Point Script Validation Terms
As you learn about script validation requirements and errors, it’s important to know certain terms. These terms are described in the following illustration and table.

Callout |
Description |
---|---|
1 |
JSDoc tags |
2 |
JSDoc tag values |
3 |
Entry point function definitions |
4 |
Script type interface (or simply interface) |
5 |
Entry points |
6 |
Entry point functions (also called script type functions) |
At a high level, the following rules apply:
-
Each script must be properly structured as described in Required Structure for Entry Point Scripts.
-
Each script file must include at least two JSDoc tags:
@NApiVersion
and@NScriptType
, and they must have valid values. Also, the value for the@NScriptType
tag must be compatible with the script. For more information, see Required JSDoc Tags for Entry Point Scripts.
Required Structure for Entry Point Scripts
An entry point script can't be associated with a script record or custom form unless it meets certain requirements. For the script to be valid, these requirements must be met:
-
The script must include one, and only one, properly structured
define
statement. The script can't include multipledefine
statements. -
The
define
statement can't include direct references to SuiteScript 2.x objects or enums. All such references must be wrapped in a function. -
The script’s
return
statement must include an interface whose entry points are associated with one, and only one, script type. In other words, thereturn
statement must include only one script type interface. See Entry Point Script Validation Terms. -
The interface for the
return
statement must include at least one entry point. -
Each entry point must correspond with an entry point function.
-
All entry point functions must be defined in the same file.
-
The script type interface implemented must match the
@NScriptType
value. -
The script must not contain any JavaScript syntax errors.
Required JSDoc Tags for Entry Point Scripts
Every entry point script must contain the @NApiVersion
and @NScriptType
JSDoc tags as described in the following table. This table includes information about possible validation errors. For more information about validation errors, see Entry Point Script Validation Error Reference.
JSDoc Tag |
Valid Values |
Purpose |
Possible Validation Errors |
---|---|---|---|
|
|
Identifies the SuiteScript version to use. 2.x and 2.X are equivalent. |
|
|
|
Identifies the type of script defined in the file. |
|
For more information about working with JSDoc tags in SuiteScript 2.x, see SuiteScript 2.x JSDoc Validation.
If you are currently using SuiteScript 2.0 for your scripts, consider updating your scripts to use SuiteScript 2.1. SuiteScript 2.1 includes new language features that are provided by a newer version of ECMAScript. For more information, see SuiteScript 2.1 and SuiteScript Versioning Guidelines.