Form scripting allows you to create a script to perform a variety of actions within the Microsoft Dynamics CRM client application running in Microsoft Internet Explorer on the user's computer, including Microsoft Dynamics CRM for Outlook. When data is available in the client, using scripts to perform actions there provides better performance than using methods that require the user to save the record to perform the actions on the Web server.
To do customizations that affect the full Microsoft Dynamics CRM organization, you must have the System Administrator or System Customizer security role , or equivalent privileges.
Scripts can perform a wide range of actions, such as:
When you develop scripts that interact with forms, be sure to use only the supported objects, properties, and methods that are documented in the Microsoft Dynamics CRM SDK. This will help to ensure that your form scripting customizations can be upgraded to the next version of Microsoft Dynamics CRM.
Microsoft Dynamics CRM, write a script using JScript. Associate the script with events on the Microsoft Dynamics CRM form or fields within the form.
Microsoft Dynamics CRM supports the following events on every entity form: OnLoad, OnSave, TabStateChange, and OnReadyStateComplete. The TabStateChange event indicates when the tab is expanded or collapsed.
The OnChange event is available on every field in the form.
This means that you can include logic within a form to run when the form loads, when a user saves the form, or when the value of a field on the form changes. Microsoft Dynamics CRM processes the OnChange event first, and then the data in the field is validated again following the execution of the OnChange event code.
Each form or field provides an Events dialog where scripts can be pasted and enabled. After you save and publish the event, the scripts become part of the metadata for the entity. This means that they can be exported and imported with other customizations. More information: Add event handlers for field events, Add event handlers for form events