SuiteScript 2.x Client Script Type
Client scripts are scripts that are executed by predefined event triggers in the client browser. They validate user-entered data and auto-populate fields or sublists during form events. For details, see SuiteScript 2.x Client Script Entry Points and API.
Scripts can be run on most standard records, custom record types, and custom NetSuite pages such as Suitelets. See SuiteScript Supported Records for a list of NetSuite records that support SuiteScript.
Client scripts only execute when you're in edit mode. If you've got a deployed client script with a pageInit entry point, it doesn't run when you view the form. It executes when you click Edit.
The following triggers can run a client script:
-
Loading a form for editing
-
Entering or changing a value in a field (before and after it is entered)
-
Entering or changing a value in a field that sources another field
-
Selecting a line item on a sublist
-
Adding a line item (before and after it is entered)
-
Saving a form
Record-level client scripts run after form-based clients and before user event scripts.
See Script Type Usage Unit Limits for details about client script governance.
You can set the order in which client scripts execute on the Scripted Records page. See The Scripted Records Page.
You can use SuiteCloud Development Framework (SDF) to manage client scripts in your file-based customization projects. For information about SDF, see SuiteCloud Development Framework. You can use the Copy to Account feature to copy an individual client script to another of your accounts. Each client script page has a clickable Copy to Account option in the upper right corner. For information about Copy to Account, see Copy to Account.
You can use SuiteScript Analysis to learn about when the script was installed and how it performed in the past. For more information, see Analyzing Scripts.
For additional information about SuiteScript 2.x client scripts, see the following:
Related Topics
- SuiteScript 2.x Script Types
- SuiteScript 2.x Bundle Installation Script Type
- SuiteScript 2.x Map/Reduce Script Type
- SuiteScript 2.x Mass Update Script Type
- SuiteScript 2.x Portlet Script Type
- SuiteScript 2.x RESTlet Script Type
- SuiteScript 2.x Scheduled Script Type
- SuiteScript 2.x Suitelet Script Type
- SuiteScript 2.x User Event Script Type
- SuiteScript 2.x Workflow Action Script Type