Record-Level and Form-Level Script Deployments
A client script can be deployed either at the record level or at the form level. All other entry point script types can be deployed only at the record level.
-
Record-level Deployment
When you deploy a script at the record level, it's deployed globally on one or more record types and will run on all forms associated with that record type. For example, you would deploy a script to run on the employee record type to have the script run whenever the employee record is used, regardless of which form it is being used on.
With record-level deployment, you can limit script execution by configuring it to be available only to certain audiences. With this approach, the script runs only when the record is used by people in certain roles, groups, or other classifications, as configured on the Audience subtab of the script deployment record.
However, with record-level deployment, you can't limit the script to run on only one form as you can with form-level deployment. The script runs the same way on all forms associated with the record type it is deployed on.
Note:Record-level client scripts can also be used on forms and lists that have been generated through the use of Suitelets. Form-based client scripts can't be used by Suitelets.
-
Form-level Deployment
When you deploy a client script at the form level, you attach it to a custom form for a record type, and it only runs when that form is used. For example, you could attach a client script to a custom entry form for the employee record type. When a user opens the employee record using the standard entry form, the script won't run. It will only run when the user opens the custom form for the employee record.
You can attach a client script to any custom entry form, custom transaction form, or custom address form. However, you can't limit the audience for a form-level script as you can with a record-level script deployment.
Hidden form fields can't be accessed or manipulated by client scripts.
For information about deploying a script at the record level, see SuiteScript 2.x Record-Level Script Deployments. For information about deploying a client script at the form level, see SuiteScript 2.x Form-Level Script Deployments.