Freigeben über


CRM 2011 Custom Form Notification

The notification area on the CRM Form is a nice place to put information, warnings and critical information.

This can be easily done with the following javascript function:

 addNotification = function (message, level) { 
 var notificationsArea = document.getElementById('crmNotifications'); 
 if (notificationsArea == null) { 
 alert('div not found'); 
 return; 
 } 
 
 if (level == 1) { //critical 
 notificationsArea.AddNotification('mep1', 1, 'source', message); 
 } 
 if (level == 2) { //Info 
 notificationsArea.AddNotification('mep3', 3, 'source', message); 
 } 
 if (level == 3) { //Warning 
 notificationsArea.AddNotification('mep2', 2, 'source', message); 
 } 
 if(message == "") 
 { 
 notificationsArea.SetNotifications(null, null); 
 } 
 
}

This will result in the following...

Comments

  • Anonymous
    November 10, 2011
    Hi John Thanks for sharing the code. I would like to know is that possible to have the CRMNotification on the customized tab level rather than on the top bar of form leve? if yes do you know how do i do that please? Thanks Faisal

  • Anonymous
    December 06, 2011
    Hi Faisal. This is the using the OOTB notifications area so you can't relocate it. But you could put a web resource on the page in another location that works like the notificaiton area.

  • Anonymous
    January 18, 2012
    Hi John- If I want to display on the Opportunity Form based on a Picklist option, how would I do this? Create Webresource with code, then do I need to create message? Thanks for any guidance.

  • Anonymous
    January 18, 2012
    You will put the function that I have above into a common Java Script library. You will associate that library to the opportunity form. Then add JavaScript to the OnChange event of the picklist field that you want to trigger the message. In the on change event you will look at the value of the picklist and set the message using the addNotification function above.

  • Anonymous
    January 23, 2013
    The comment has been removed