Sunday, October 9, 2011

Showing Alerts on CRM Form notification Area using JScript

it is possible to Add alerts to the Alert list control on a form.
The code is very simple :

The Alerts are ordered by priority.

var mep=1;

function set_alert()
{
var notificationsArea = document.getElementById('crmNotifications');
if (notificationsArea == null)
{
alert('div not found');
return;
}

if (mep==1)
{
notificationsArea.AddNotification('mep2', 2, 'source', 'Warning message');
notificationsArea.AddNotification('mep3', 3, 'source', 'Info message');
notificationsArea.AddNotification('mep1', 1, 'source', 'Critical message');
mep=2;
}
else
{
notificationsArea.SetNotifications(null, null);
mep=1;
}
}

No comments:

Post a Comment