Here’s an example of how to call the function (I retrieve the details of one lookup field and then call the above function to populate another lookup field):
Set the Requirement Level of a Field:
Note: this example sets the requirement level of the Address Type field on the Account form to Required.
Note: setRequiredLevel(“none”) would make the field optional again.
Disable a field:
Hide a field:
Hide a nav item:
Note: you need to refer to the nav id of the link, use F12 developer tools in IE to determine this
Hide a Section:
Note: Here I provide a function you can use. Below the function is a sample.
Save the form:
Save and close the form:
Close the form:
Note: the user will be prompted for confirmation if unsaved changes exist
Determine the Form Type:
Note: Form type codes: Create (1), Update (2), Read Only (3), Disabled (4), Bulk Edit (6)
Determine the GUID of the current record:
Determine the GUID of the current user:
[MVP CRM] = https://mvp.support.microsoft.com/profile/imran.mustafa
Linkedin = http://www.linkedin.com/in/mscrmexpert
Twitter = @mscrmexpert