Showing Notification Message – Error/Warning/Info

In CRM 2011 you can display your own notification message on a form and brand it with Error/Warning/Info icon.

Here’s an example of an info notification message:

Notification

To do so, insert this JavaScript function and execute it on load of the form:

function ShowMessageOnForm(msg, type) {
  //var notificationsArea = document.getElementById('crmNotifications');  // code works prior to UR12
  var notificationsArea = $find('crmNotifications'); // code works with UR12 (Polaris)
  /*
  The integer is the notification type
  1 = Error
  2 = Warning
  3 = Info
  notificationsArea.AddNotification("<;unique value>;", 3, "","Your text here");
  */
  notificationsArea.AddNotification(GenerateGuid(), type, "", msg);
}
Advertisements

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