Localization Context Filtering for SuiteScript 2.x

You can set the localization context for client or user event scripts. Localization context filtering lets you run a script based on the country linked to the active record or transaction and keeps scripts from running when they aren't needed.. For a list of records and transactions that support localization, see Records that Support Localization Context.

You can set the order to run for localized client and user event scripts. NetSuite supports up to 10 localized or non-localized client scripts. For more information, see The Scripted Records Page.

NetSuite automatically determines the localization context for records and transactions using country fields like subsidiary and tax nexus. Make sure you understand how this works before setting up localization context filtering for scripts. For details, see Determining the Localization Context.

The localization context feature includes:

The table below shows how to set the lcoalization context for each script type.

Script Type

Defining Localization Context Filtering

SuiteScript 2.0 Client Script Type

Follow these steps to add localization context filtering to client scripts:

  1. Use the localizationContextEnter(scriptContext) and localizationContextExit(scriptContext) entry points in your script.

  2. Set the lcoalization context on the Context Filtering tab of the script deployment record. For more information, see Localization Context.

SuiteScript 2.0 User Event Script Type

Set the localization context on the Context Filtering tab of the script deployment record. For more information, see Localization Context.

If you localize a script deployment on the Context Filtering tab, the pageInit entry point is ignored, and no other entry points run before localizationContextEnter or after localizationContextExit. Sometimes, a record might never enter a localization context. For more information, see SuiteScript 2.x Client Script Entry Points and API.

Related Topics:

General Notices