http://www.powerobjects.com/2015/09/23/dynamics-crm-alert-and-notification-javascript-methods/
Before CRM, if you wanted to alert a user on a form within the browser, the only method available is the standard Ja Vascript alert. This method would open a alert window over the record the user was viewing, which then must be acknowledged in order for T He user to continue.
The Code,
Alert ("This was a standard alert")
Produces the pop up window as illustrated below.
With CRM, Microsoft introduced a additional alert method that's specific to CRM, Xrm.Page.ui.setFormNotification. This newer method allows your to specify three different types of alerts:error, information, and warning. Furthermore, instead of popping a window open over the current window, setformnotification embeds the notification in the CRM page itself. These codes:
Xrm.Page.ui.setFormNotification ("This was an information notification.", "Information") Xrm.Page.ui.setFormNotification ("This is a WARNING notification. "," WARNING ") Xrm.Page.ui.setFormNotification (" This was an ERROR notification. "," Eror ")
Produce the notifications in the screenshot below that is visible just under the Account record title.
The Code
Xrm.Page.ui.clearFormNotification ()
Can is used to clear these notifications.
Additionally, you can call out specific fields with the Setnotification method. The Code
Xrm.Page.getControl ("Fax"). Setnotification ("This was a notification about the fax field")
Produces the notification attached to the Fax field on the account record shown below.
With these different methods, what can now carefully choose what overt or subtle you would like to is in calling out Importa NT information on a record to users.
Want to stay-to-date with our blog? Subscribe today!
Happy CRM ' ing!
Turn Dynamics CRM Alert and Notification JavaScript Methods