SuiteScript

This release note was updated September 16, 2024.

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

Changes to External Suitelet URLs

Suitelets that are available without login have updated External URLs as of May 9, 2024. The new URL is displayed in the External URL field on the script deployment record and uses the &ns-at= parameter followed by a new value. To prevent broken links to Suitelets that are accessed with hard-coded URLs, you must update those links to the new format.

Give special consideration to the following:

  • All hard-coded URLs are impacted.

  • Cases where the URL is resolved automatically, using url.resolveScript(options) and similar methods, do not require any action.

Hard-coded URLs can be found in various places:

  • In scripts and HTML files in your account

  • Occasionally in other places like script parameters

  • In external systems that retrieve information or trigger actions

  • Links on your Web site

  • In rare cases, where a Suitelet is used as a public Web site, it might be referenced by search engines

Tips for locating and updating hard-coded URL that call external Suitelets:

  • The previous format that will now result in broken links uses the &h= parameter and a different value. For example, /app/site/hosting/scriptlet.nl?script=123&deploy=123&h=ABCDFEFGHIJKLMNOPRSTUV would now be updated to /app/site/hosting/scriptlet.nl?script=123&deploy=123&ns-at=KLMNOPRSTUVABCDFEFGHIJ.

  • New External URLs can be found on the Script Deployment record of Suitelets that have the Available Without Login preference enabled. Script Deployments are found in most accounts at Customization > Scripting > Script Deployments.

  • See Search for Scripts Containing Hard-coded URLs with &h Parameter, SuiteAnswers article 1016553, for a possible solution to find affected URLs in your account. As with all script samples, this solution is not guaranteed to work in your account due to varying features, permissions, and settings.

Changes to url.resolveScript(options) and https.requestSuitelet(options)

Starting July 30, 2024, returning external URLs with url.resolveScript(options) will only be allowed for authenticated sessions. Scripts using url.resolveScript(options) with the returnExternalUrl parameter set to true will no longer work in untrusted contexts. To avoid errors, you must review scripts that use the url.resolveScript(options) method with the returnExternalUrl parameter set to true and ensure that this setting is used only in a trusted context.

Effective June 13, 2024, https.requestSuitelet(options) will be supported for internal URLs in trusted contexts. This will become the default behavior, without the need of setting the option.external parameter. On July 30, 2024, use of option.external=true will stop working, and https.requestSuitelet(options) will only work for internal Suitelets. This change also applies to the promise version: https.requestSuitelet.promise(options).

Untrusted contexts include:

  • A client script where all roles are selected in the Roles field on the Audience subtab of the script deployment, AND

  • The client script is running for users whose identity cannot be identified, such as customers and shoppers on Web sites.

Trusted contexts include:

  • External Suitelets accessed with the updated External URL from the script deployment record.

  • Suitelets called within an authenticated session, such as within NetSuite UI pages for logged in users. These Suitelets are internal and do not require the Available Without Login preference.

  • Client scripts called within an authenticated session, such as within NetSuite UI pages for logged in users.

Suitelets that are accessed through Web sites on the server side can remain external with the Available Without Login preference enabled. You can access Suitelets using the new External URL format on the script deployment record.

For more information, see the following topics:

New N/pgp Module

A new N/pgp module is now available. The N/pgp module loads generated PGP keys from a secret to securely send messages to one or multiple recipients. To send an encrypted message, you must first create the contents of the message with the pgp.createMessageData(options) method. Next, use the MessageData.encrypt(options) method to securely encrypt and optionally sign the message contents. Message recipients can optionally enable configuration preferences to customize how messages are decrypted.

You can also use this module to create certificate.Signer objects to sign plain strings. For more information, see N/pgp Module.

Changes to RESTlet script and New N/scriptTypes/restlet Module

Currently, any RESTlet script that returns HTML content is determined by the Content-Type header in the HTTP request. If the Content-Type header of the HTTP request has a value, the value gets passed to the HTTP response. If there is no Content-Type header defined in the HTTP request, the default value of the HTTP response Content-Type header is HTML (or text/html).

As of September 30, 2024, any RESTlet script that does not have a defined HTTP request Content-Type header will have a default HTTP response Content-Type header of plain text (or text/plain). If you require any RESTlet scripts to have a return value in HTML format, you must update these scripts. Use the restlet.createResponse(options) method of the new N/scriptTypes/restlet module to set the RESTlet's HTTP response Content-Type header to text/html explicitly.

The restlet.createResponse(options) method lets you specify the Content-Type header for your Restlet response to ensure that it is in the format that you intend it to be. You can use this method in the return statement of your RESTlet script’s entry point functions. For more information, see N/scriptTypes/restlet Module.

Changes to the Hide in SuiteBundle Preference

Some SuiteApps and SuiteBundles may include scripts or files that were marked as Hide in SuiteBundle but must be accessed in the browser, such as client scripts or library files and assets needed on the client side. Enablement of the Hide in SuiteBundle preference for this type of file is not a valid configuration.

In preparation for this change, accounts with such SuiteApps and bundles installed have been updated to clear the Hide in SuiteBundle preference for scripts and files that have been run on the client side.

As of NetSuite 2024.2, any scripts that have the Hide in SuiteBundle preference enabled will fail to run if accessed on the client side.

Newly Supported Record Actions in 2024.2

The following table lists the newly supported record actions for SuiteScript in 2024.2.

Record Type

Action

Description

Inventory Count

approve

Changes the status of completed counts to Approved

Inventory Count

reject

Reassigns the Open status to completed counts

Inventory Count

startcount

Changes the status of Open inventory counts to Started

Inventory Count

completecount

Changes the status of counts from Started to Completed/Pending approval

Completely Billed

markprojectascompletelybilled

Billed completely

Newly Supported Record Types in 2024.2

The following table lists the newly supported records in SuiteScript for 2024.2.

Record Type

Notes

As Charged Project Revenue Rule

This record is available when the Projects Management, Charge-Based Billing and Advanced Revenue Management features are enabled.

Currency Rate

When the Multiple Currencies feature is enabled, this record is partially scriptable. It can be created, read, copied, and searched.

When the Multiple Currencies feature is not enabled, this record is not scriptable.

Resource Group

The resource group record is scriptable in server and client SuiteScript.

Removal of the Ext JS Library in 2025.1

NetSuite has started the process to remove the unsupported Ext JS library. If your customizations rely on this library's API, despite its lack of support, you should prepare for this removal as soon as possible.

To help you identify usages of the library in your account, a banner message will be displayed on pages that load a script using the unsupported Ext JS library. This banner display will be available in accounts running NetSuite 2024.2.

The Ext JS library will be removed in NetSuite 2025.1. The removal of the Ext JS library may break external references to it. If you want to continue using the Ext JS library, you must replace it with your own external instance of the library. Otherwise, you need to adjust your code to work without the use of the Ext JS library.

2024.2 SuiteScript Records Browser

The 2024.2 SuiteScript Records Browser is not yet available.

General Notices