Enable Form Notifications

The question was asked!, how can I enable the Form Notifications on Microsoft Dynamics CRM 2013.
The notification section is not available on all the forms, like custom entity forms, and I want to add notifications to those forms with other validation on fields events.

using the browser developer tools on the forms where the notification is available, i found the following element “crmNotifications” that will display the notification and show the message

// Enable Form Notifications

function Notifications() {

    var crmNotificationsDiv = document.getElementById("crmNotifications");
    crmNotificationsDiv.style.display = "block";

    Xrm.Page.ui.setFormNotification('Notifications Error', 'ERROR', '1');
    Xrm.Page.ui.setFormNotification('Notifications Warning', 'WARNING', '2');
    Xrm.Page.ui.setFormNotification('Notifications Info', 'INFO', '3');
    alert('Completed Notification!');

function NotificationMsg(FieldName, Msg, TypeMsg, MsgId) {
    var crmNotificationsDiv = document.getElementById("crmNotifications");
    crmNotificationsDiv.style.display = "block";

    Xrm.Page.ui.setFormNotification(Msg, TypeMsg, MsgId);
    Xrm.Page.ui.setFormNotification(Msg, TypeMsg, '2');
    Xrm.Page.ui.setFormNotification(Msg, TypeMsg, '3');

function clearNotifications(FieldName, MsgId) {


    var crmNotificationsDiv = document.getElementById("crmNotifications");
    crmNotificationsDiv.style.display = "none";

The code will help you to add a message on a single line or the same message on all 3 lines, also you can assign the message to a specific field, the clearNotifications as the function indicates will clear all the messages on the notifications section.

I been using the following functionality, with my custom entity forms and it works fine, a little more work need to be implemented but that will be implemented in the near future.

hope you can use the following code!, and also please remember that the code is unsupported and can stop working with the coming roll up or Service packs updates.

Contact us for a free consultation if you have any further questions.

Abe Saldana.

Get membership Access to all Content!

Get Access to the most updated content for Dynamics 365 and other technologies, receive emails when we post New Content and when we have new Videos, and Live Sessions! Subscribe to get our latest content by email. Also to get and download the source code on the new blog post!

We won't send you spam. Unsubscribe at any time. You will receive emails from AbeSaldana.com Powered by ConvertKit

Leave a Reply

Your email address will not be published. Required fields are marked *

Blue Captcha Image