SuiteScript 2.1 JSDoc Tags

The following table describes the available SuiteScript 2.1 JSDoc tags. SuiteScript 2.1 entry point scripts must include the following two tags:

For more information about entry point validation, including possible errors, see SuiteScript 2.x Entry Point Script Validation.

JSDoc Tag

Possible Values

Required/Optional

Description

@NApiVersion

2.0

2.1

2.x

2.X

Required for entry point scripts

Optional for custom modules

This tag is used in two ways:

  • For SuiteScript entry point scripts, this tag is a required declaration. It indicates to NetSuite which SuiteScript version to use.

  • For SuiteScript custom modules that are not entry point scripts, this tag is an optional declaration to specify the script version. This tag can be used to prevent compatibility issues if a script that references your custom module uses another SuiteScript version with language features or syntax that your custom module does not support.

The 2.x value is case-insensitive and usually represents the latest generally available SuiteScript version. By default, 2.x resolves to SuiteScript 2.0. If the Execute SuiteScript 2.x Server Scripts As preference is set to 2.1, compatible 2.x scripts can run as SuiteScript 2.1. For more information about SuiteScript versioning, see SuiteScript Versioning Guidelines. To learn more about the account-level preference, see Enabling SuiteScript 2.1 at the Account Level.

@NScriptType

BundleInstallationScript

ConsolidatedRateAdjustorPlugin

CustomGLPlugin

ClientScript

CustomTool

EmailCapturePlugin

MapReduceScript

MassUpdateScript

PaymentGatewayPlugin

PluginTypeImpl

Portlet

PromotionsPlugin

Restlet

ScheduledScript

ShippingPartnersPlugin

Suitelet

TaxCalculationPlugin

UserEventScript

WorkflowActionScript

Required for entry point scripts

This tag identifies the type of script defined in the file.

@NModuleScope

SameAccount

TargetAccount

Public

Optional

This tag is used to control access to scripts and custom modules.

  • If the value is set to SameAccount, access to the module is limited to other modules from the same bundle, as well as modules native to the same source account and any associated sandboxes and Release Preview accounts.

    Source code is not hidden at runtime.

  • If the value is set to TargetAccount, access to the module is limited to other modules from the same bundle, as well as modules native to the same source account, target account, and any associated sandboxes and Release Preview accounts.

    Source code is hidden at runtime.

  • If the value is set to Public, any script in the account can load and use the module.

    Source code is hidden at runtime.

The default value is SameAccount.

Note:

If your script contains SuiteScript 2.1 syntax that includes classes and will be included in a bundle, the @NModuleScope JSDoc tag must be set to SameAccount.

For more information on each of these values, see SuiteScript Module Scope and Access Control.

Related Topics

General Notices