SuiteScript

This release note was updated March 17, 2025.

Refer to the following sections for details on SuiteScript updates for NetSuite 2025.1:

Removal of the Ext JS Library in 2025.1

As of NetSuite 2025.1, the unsupported Ext JS library is no longer available in NetSuite. The removal of the Ext JS library may break external references to it after your account is upgraded to 2025.1.

If your customizations rely on the Ext JS library’s API despite its lack of support, you must do one of the following to ensure that your customizations will continue to work after your account is upgraded to 2025.1:

  • Adjust your code to work without the use of the Ext JS library.

  • To continue using the Ext JS library, you must replace it with your own external instance of the library.

After you have made script updates, you can test these updates by requesting a change to your account that will remove the Ext JS library before your account is upgraded to 2025.1. To test your changes and preview the upcoming removal of the Ext JS library, contact NetSuite Customer Support for assistance.

Changes to Audience Settings in Script Deployments and Single Page Applications

Previously, selecting all roles on the audience setting for scripts and single page applications (SPAs) meant that any role (internal and external) had access to the script or SPA.

Starting 2025.1, when you select all roles on the audience setting for SuiteScript scripts and SPAs, only internal roles are selected. Additionally, internal and external roles are now shown in two separate multiselect fields.

When your account is upgraded to 2025.1, expect the following changes to the UI and SDF XML reference for script deployments and SPAs:

Changes to Script Audience Settings

The Audience subtab on the script deployment record now includes separate lists for internal roles and external roles:

  • Internal Roles – Includes a multiselect field with a list of internal roles. You can select individual roles from the list or check the Select All box to make the script available to all internal roles.

  • External Roles – Includes a multiselect field with a list of external roles, which you can select individually.

For the scriptdeployment structured field within each script type SDF custom object, the behavior of the following fields has changed:

  • allroles – Setting this field to T (true) means that all internal roles are selected.

  • audslctrole – You can use this field to specify roles individually, including any external roles, in the script audience. If the allroles is set to T, any internal roles listed in the audslctrole field will be ignored.

These changes apply to the following custom objects for script types:

  • clientscript

  • massupdatescript

  • portlet

  • restlet

  • suitelet

  • usereventscript

  • workflowactionscript

Changes to SPA Audience Settings

The Audience Setup window on the SPA Management page now includes separate lists for internal roles and external roles:

  • Internal Roles – Includes a multiselect field with a list of internal roles. You can select individual roles from the list or check the All Internal Roles box to make the SPA available to all internal roles.

  • External Roles – Includes a multiselect field with a list of external roles, which you can select individually.

For the singlepageapp SDF custom object, the behavior of the following fields have changed:

  • audienceallroles – Setting this field to T (true) means that all internal roles are selected.

  • audienceroles – You can use this field to specify roles individually, including any external roles, in the SPA audience. If the audienceallroles is set to T, any internal roles listed in the audienceroles field will be ignored.

Removal of Request Process for Single Page Applications

Starting January 2025, the request process for the Single Page Applications (SPA) feature has been removed. You can now develop SPAs if you meet the following minimum requirements:

  • Must use SuiteCloud Development Framework (SDF) SuiteApp projects

  • Must use SuiteScript 2.1

SPAs are web applications that load a single HTML page and dynamically update that page when the user interacts with it. In NetSuite, you can create SPAs with NetSuite look and feel using the NetSuite User Interface Framework (UIF), and with full SuiteScript support and SDF deployment capabilities. For more information, see Single Page Applications.

SuiteScript Generative AI API: New Methods in the N/llm Module

Two new methods are available in the N/llm module:

These new methods provide more options to interact with LLMs using SuiteScript Generative AI APIs. For more information about these APIs, see SuiteScript 2.x Generative AI APIs.

SuiteScript Generative AI API: New SuiteScript Tab on the AI Preferences Page

The AI Preferences page (previously called the Text Enhance Preferences page) now includes a SuiteScript tab. You can access the AI Preferences page by going to Setup > Company > AI Preferences.

The SuiteScript tab on the AI Preferences page.

On the SuiteScript tab, you can check the Use OCI Credentials for SuiteScript box to use the Oracle Cloud Infrastructure (OCI) credentials that are stored for your company's NetSuite account. When this box is checked, your scripts that use SuiteScript Generative AI APIs (such as the N/llm module) use the OCI credentials that are specified on the Settings tab to connect to OCI. When you select this option, your available usage is determined by your Oracle Cloud account, and you cannot use the free usage mode that is provided for your NetSuite account by default. For more information, see Using Your Own OCI Configuration for SuiteScript Generative AI APIs.

The Use OCI Credentials for SuiteScript option is available only when the Use OCI Configuration to Get Unlimited Usage option is selected on the Settings tab. You also specify your OCI credentials on the Settings tab and you must set up an API secret for authentication.

The SuiteScript tab also shows a usage summary for SuiteScript Generative AI APIs, including your usage limit per month and how much you used each month. This usage information includes API calls you make from scripts that are deployed in your account, as well as scripts that you run using the SuiteScript debugger. This usage information applies only when you are using free usage mode and not when you use your own Oracle Cloud account and OCI credentials.

You can override the OCI credentials on the Settings tab by specifying your own OCI credentials in your scripts. The following methods accept OCI credentials as parameters:

Additional Changes to Hidden Files

The stack property of Error instances and the .toString() method on functions will be functionally discontinued in hidden files. The following changes will take place in NetSuite 2025.1, with an estimated date of June 2025:

  • Usage of functionName.toString() where functionName is part of a hidden file will result in an error.

  • The stack property of an Error instance (i.e., Error.stack) will no longer show the trace of a function if it is a part of a hidden file.

Files are considered hidden if any of the following is true:

  • The file record in the File Cabinet has the Hide in SuiteBundle preference enabled.

  • Your SuiteApp has a hiding.xml file in the InstallationPreferences folder with the “HIDING” defaultAction set to “HIDE.”

  • Your SuiteApp has attribute files under FileCabinet > SuiteApps > com.netsuite.project > .attributes where the hideinbundle field is set to ‘T’.

As a script owner, if you use functionName.toString()or Error instances’ stack property in a hidden file, you must remove such usages to prevent the script functionality from breaking in target accounts.

New and Updated SuiteScript Supported Records

The following table lists new and updated records that are supported for scripting using SuiteScript.

Record Type

Newly Exposed or Updated

Notes

Prompt

Newly Exposed

The prompt record is scriptable in both client and server SuiteScript.

The prompt record is partially scriptable — it can be created, updated, and deleted using SuiteScript.

Text Enhance Action

Newly Exposed

The Text Enhance action record is scriptable in both client and server SuiteScript.

The Text Enhance action record is partially scriptable — it can be created, updated, and deleted using SuiteScript.

General Notices