web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Javascript – Notifications

Neil Parkhurst Profile Picture Neil Parkhurst 10,727 User Group Leader

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

Comments

*This post is locked for comments