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.
In the Common Tasks area, click Form Properties.
On the Events tab, click onSave or OnLoad, 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 dialog box.
On the Preview menu, click Create Form, Update Form, or Read-Only Form.
If you have added an OnLoad event for the form, when you open the form in each mode, verify that your event executed as expected.
If your code depends on data existing in the form when it loads, you may want to test your script in an onChange or onSave event so that you can enter sample data into the form. The Update Form will open with no data.
If you have added an onSave event for the form, for create and update modes, on the Form toolbar, click Simulate Form Save to see if the event executes as expected.
To close the Preview form, on the File menu, click Close.
Click Save and Close to close the form.
Click Save and Close to close the entity.
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.