Client scripts
-
- UpdatedAug 1, 2024
- 3 minutes to read
- Xanadu
- Building applications
Client scripts allow the system to run JavaScript on the client (web browser) when client-based events occur, such as when a form loads, after form submission, or when a field changes value.
Use client scripts to configure forms, form fields, and field values while the user is using the form. Client scripts can:
- make fields hidden or visible
- make fields read only or writable
- make fields optional or mandatory based on the user's role
- set the value in one field based on the value in other fields
- modify the options in a choice list based on a user's role
- display messages based on a value in a field
Client scripts are intended to optimize the user experience on a form. Client scripts are not meant to protect unwanted access to data.
To prevent unwanted access to data, ensure that sensitive fields are hidden or read-only through ACLs or data policies.
For more information, see Access Control List Rules or Data policy.
Where client scripts run
- Create an access control to restrict who can edit field values.
- Create a business rule to validate content.
- Create a data policy to validate content.
- Create an onCellEdit() client script to validate content.
- Disable list editing for the table.