Suitelet Script Deployment Page

Before a Suitelet script can be executed, you must create at least one deployment record for the script.

The deployment record for a Suitelet script is similar to that of other script types. However, a Suitelet script deployment contains some additional fields. This topic describes all of the available fields.

You can access a Suitelet script deployment record in the following ways:

Suitelet Script Deployment Page Body Fields

The following table summarizes the body fields available on the Suitelet script deployment record. Note that some fields are available only when you edit or view an existing deployment record.

Field

Description

Script

A link to the script record associated with the deployment. This value cannot be changed, even on a new deployment record. If you begin the process of creating a deployment and realize that you selected the wrong script record, you must start the process over.

Title

The user-defined name for the deployment.

ID

A unique identifier for the deployment.

On a new record, you can customize this identifier by entering a value in the ID field. You should customize the ID if you plan to bundle the deployment for installation into another account, because using custom IDs helps avoid naming conflicts. IDs must be lowercase and cannot use spaces. You can use an underscore as a delineator.

If you do not enter a value, the system automatically generates one. In both cases, the system automatically adds the prefix customdeploy to the ID created when the record is saved.

Although not preferred, you can change the ID on an existing deployment by clicking the Change ID button.

Deployed

A configuration option that indicates whether the deployment is active. This box must be checked if you want the script to execute.

Status

The status can be set to Testing or Released.

  • Testing — The script will execute for the script owner and specified audience.

  • Released — The script will run in the accounts of all specified audience members.

See Errors Related to the Available Without Login URL to learn more about the relevance of the Released status when deploying internally and externally available Suitelets.

Event Type

Use the Event Type list to specify a script execution context at the time of script deployment.

After an event type is specified, the deployed script executes only on that event, regardless of the event types specified in the script file.

Important:

Event types specified in the UI take precedence over the types specified in the script file. For example, if the create event type is specified in the script, selecting delete from the Event Type list restricts the script from running on any event other than delete. If the Event Type field is left blank, your script will execute only on the event type(s) specified in the script file.

Log Level

A value that determines what type of log messages are displayed on the Execution Log of both the deployment record and associated script record. The available levels are:

  • Debug — suitable for scripts still being tested; this level shows all debug, audit, error and emergency messages.

  • Audit, Error, or Emergency — suitable for scripts in production mode. Of these three, Audit is the most inclusive and Emergency the most exclusive.

Execute As Role

Indicates the role used to run the script.

Available Without Login

Indicates if users without an active NetSuite session can access the Suitelet. See Setting Available Without Login.

Setting Available Without Login

When you select Available Without Login and then save the Script Deployment record, an External URL appears on the Script Deployment page. Use this URL for Suitelets you want to make available to users who do not have an active NetSuite session.

Only a subset of the SuiteScript API is supported in externally available Suitelets (Suitelets set to Available Without Login on the Script Deployment page). Note that if you want to use all available SuiteScript APIs in a Suitelet, your Suitelet will require a valid NetSuite session. (A valid session means that users have authenticated to NetSuite by providing their email address and password.)

The Website feature must be enabled for Clients Scripts to work in externally available Suitelets

Note:

For NetSuite 2019.1, two fields display: External URL (Deprecated) uses a forms.netsuite.com domain that will no longer be supported as of NetSuite 2020.1. The External URL field displays the account-specific domain, <accountID>.extforms.netsuite.com, which is supported for 2019.1 and future releases. For more information about NetSuite domains, see Understanding NetSuite URLs.

If you need to perform Outbound HTTPs calls in an unauthenticated client-side context, you must do so inside a Suitelet available without login and call that Suitelet using N/https#requestSuitelet() instead of calling one of the prohibited functions directly. See: Outbound HTTPs in an unauthenticated client-side context

The following are a few uses cases that address when you might want to make a Suitelet externally available:

For access or redirection from another script to a Suitelet, the best practice is to use url.resolveDomain(options) to discover the URL instead of hard- coding the URL.

Note:

Suitelets are not intended for use in systems integration use cases.

Important:

Because there are no login requirements for Suitelet that are available without login, be aware that the data contained within the Suitelet will be less secure.

Errors Related to the Available Without Login URL

You will use either the internal URL or the external URL as the launching point for a Suitelet.

Some factors that determine whether a Suitelet will successfully deploy are:

The following table summarizes these dependencies:

Suitelet URL Type

Deployment Status

Select All check boxes

Result

internal

Testing

not checked

Suitelet deploys successfully

internal

Testing

checked

Suitelet deploys successfully

internal

Released

not checked

Error message: You do not have privileges to view this page.

internal

Released

checked

Suitelet deploys successfully

external

Testing

not checked

Error message: You are not allowed to navigate directly to this page.

external

Testing

checked

Error message: You are not allowed to navigate directly to this page.

external

Released

checked

Suitelet deploys successfully

external

Released

not checked

Error message: You do not have privileges to view this page.

Suitelet Script Deployment Page Audience Subtab

Use the Suitelet Script Deployment page's Audience subtab to specify the roles that can access your Suitelet.

The following table summarizes the Audience subtab fields.

Field

Description

Roles

Select the Roles that can access your Suitelet. To give access to all Roles, check the All Roles box.

If you do not select any Roles, the script will not run.

Groups

Select the Groups that can access your Suitelet. If you do not select any Groups, all Groups have access.

Partners

Select the Partners that can access your Suitelet. To give access to all Partners, check the All Partners box.

Departments

Select the Departments that can access your Suitelet. If you do not select any Departments, all Departments have access.

Employees

Select the Employees that can access your Suitelet. To give access to all Employees, check the All Employees box.

Suitelet Script Deployment Page Links Subtab

Use the Suitelet Script Deployment page's Links subtab to create links in NetSuite Centers to your Suitelet. For example, create a link to a Suitelet from the Support Section in the Classic Center.

The following table summarizes the Links subtab fields.

Field

Description

Center

The NetSuite Center's from which users can access your Suitelet.

Section

The NetSuite section of your Suitelet. Users access your Suitelet from this section.

Category

The category of the Suitelet.

Label

The name of the Suitelet. Users see this label in the section menu, after the category name.

Translation

If you have the multi-language feature enabled for your NetSuite account, you can add translations for your Suitelet label in the Translation column.

Insert Before

Specify the section category you would like to insert your Suitelet before.

Related Topics

SuiteScript 2.x Suitelet Script Reference
How Suitelet Scripts are Executed
Reserved Parameter Names in Suitelet URLs
Embedding HTML in Suitelets

General Notices