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, not at the form level.
-
Record-level Deployment
When you deploy a script at the record level, you deploy it globally on one or more record types. The script runs on all forms associated with that record type. For example, you could use record-level deployment to configure a script to run on the employee record type. With this approach, the script runs whenever the employee record is used, regardless of which form it is being used on.
With record-level deployment, it is possible to limit the script 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 cannot 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 cannot be used by Suitelets.
-
Form-level Deployment
When you deploy a client script at the form level, you attach the script to a custom form associated with a record type, and the script runs only when that custom 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 will not run. It will only run when the user opened 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 cannot limit the audience for a form-level script as you can with a record-level script deployment.
Hidden fields from the form cannot 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.