Javascript – Notifications

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(“1”);

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();

One thought on “Javascript – Notifications

  1. Pingback: Happy New Year – Pop Pickers | Microsoft Dynamics CRM and Unified Service Desk

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s