Entry Point Script Validation Guidelines
For an entry point script to be valid, its structure must meet certain requirements. If it does not meet all requirements, you can't create a script record for the script, and you can't attach the script to a form. In some cases, you won't be able to upload the script file to the File Cabinet if all requirements are not met.
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.
For more information, see the following:
Entry Point Script Validation Terms
When learning about script validation requirements and errors, it is important to understand 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. Additionally, the@NScriptType
tag must be compatible with the script included in the file. For more information, see Required JSDoc Tags for Entry Point Scripts.
Required Structure for Entry Point Scripts
An entry point script cannot 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 cannot include multipledefine
statements. -
The
define
statement cannot include direct references to SuiteScript 2.0 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. -
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 described in the following table. This table includes information about some 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, including details on the correct format, 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 the ECMAScript 2019 specification. For more information, see SuiteScript 2.1 and SuiteScript Versioning Guidelines.