Microsoft Dynamics CRM 2015 exposes events for forms, fields, and other controls. These are the event handlers where we can call our custom JavaScript methods. We can configure our client-side code to execute on specific events or dynamically associate our method to a corresponding event. Let's first understand events related to forms.
Two events—OnLoad
and OnSave
—are exposed for entity forms where we can write our client-side code.
The OnLoad
event handler executes code when the entity form is loaded. We can utilize this event for controlling the behavior of entity forms and this event is useful for different scenarios. For example, we may want to hide/disable some fields based on other fields or based on the user security role. Business rules also utilize the OnLoad
event to execute logic. We will be discussing business rules in a later topic. If we are not working in updated entity forms then OnLoad
is executed whenever the form is...