Form Events
Two events are global in nature for all forms: the onLoad event and the onSave event.
The onLoad event fires after the form has completed loading, and is commonly used to send an alert to the user, disable fields, or modify field values.
The onSave event fires when the Save or Save and Close buttons are accessed, and it is important to note that it fires regardless of whether data on the form has been changed. This event is commonly used to validate an entry because the onSave event can cancel the save operation.
In addition to the form events, the onChange event is available for every field on a CRM form. To fire the onChange event, the field that has the event attached to it must have its value changed, and it must lose the focus (by the user selecting or tabbing elsewhere on the form).
These events are utilized by writing JavaScript, and our first two examples at the end of this chapter show these events in action.