This task requires the System Administrator or System Customizer security role A defined set of privileges. The security role assigned to a user determines which tasks the user can perform and which parts of the user interface the user can view. All users must be assigned at least one security role in order to access the system. or equivalent permissions. Customization tasks can be performed only while you are online. More information: Customization Permissions
In the Navigation Pane, click Settings, click Customization, and then click Customize Entities.
Open the entity and then click Forms and Views.
Click Form, then on the Actions toolbar, click More Actions, and then click Edit.
Select a field on the form.
Click Change Properties.
On the Events tab, select onChange, and then click Edit.
In the Event Detail Properties dialog box, on the Details tab, select the Event is enabled check box to enable the event, and in the text box, enter the body of the script that you want to use when the selected event is run.
On the Dependencies tab, in the Available fields list, select any fields you have referenced in scripts, and then click the Add Selected Records button to move the selected fields to the Dependent fields list.
Click OK to close the Event Detail Properties form.
Click OK to close the Field Properties form.
Test your script in the three modes a form can be used: create, update, and read-only:
On the Preview menu, click Create Form, Update Form, or Read-Only Form.
For the create and update modes, enter data in the field and move focus off the field by selecting a different field to verify that the script executes.
To close the Preview form, on the File menu, click Close.
Click Save and Close to close the form.
When your customizations are complete, publish your customizations:
To publish customizations for the entity you are currently editing, on the Actions menu, click Publish.
To publish customizations for all entities at once, open the Customize Entities list. On the More Actions menu, click Publish All Customizations.
To publish customizations for specific entities, open the Customize Entities list and select the entities you want to publish. On the Actions toolbar, click Publish.
Important
You should have a thorough knowledge of JScript programming syntax and an understanding of DHTML before adding scripts, and should test your scripts before you publish customizations. Malformed scripts can prevent the form from working correctly.
When you use an event-based script or custom code that refers to specific fields, you should set these fields as dependent fields so that they cannot be deleted from forms.