Javascript – Notifications
Views (4293)
It is possible (and now supported) to show notifications on CRM forms, use the following code to show notifications.
Xrm.Page.ui.setFormNotification(<<Message>>, <<Level>>, <<uniqueId>>);
Xrm.Page.ui.setFormNotification("Give some Info!", "INFO", "1");
Xrm.Page.ui.setFormNotification("Give a warning!", "WARNING", "2");
Xrm.Page.ui.setFormNotification("Give an error!", "ERROR", "3");
The notifications will look like this ….

You can also remove a notification using the command below;
Xrm.Page.ui.clearFormNotification(<<uniqueId>>);
You can also set notification on a particular control.
Xrm.Page.getControl(<<fieldname>>).setNotification(<<message>>)
For example:
Xrm.Page.getControl("department").setNotification("There is some kind of error with department!");

Note: The form will not be saved until the notification is cleared!
Xrm.Page.getControl(<<fieldname>>).clearNotification()

Like
Report
*This post is locked for comments