Posted in CRM, JavaScripts

Notifications in MSCRM using Javascript

Notifications in MSCRM using Javascript

setFormNotification

Syntax:

Xrm.Page.ui.setFormNotification(message, level, uniqueId);
Parameter Name Type Description
message String The text of the message
level String The level defines how the message will be displayed.
ERROR : Notification will use the system error icon.
WARNING : Notification will use the system warning icon.
INFO : Notification will use the system info icon.
uniqueId String A unique identifier for the message used with clearFormNotification to remove the notification.

Example: Display all Form Level Notifications on OnLoad of Account entity.

function formNotification()
{
Xrm.Page.ui.setFormNotification("This is an INFORMATION notification.", "INFORMATION")
Xrm.Page.ui.setFormNotification("This is a WARNING notification. ", "WARNING")
Xrm.Page.ui.setFormNotification("This is an ERROR notification. ", "EROR")
}

092315_1312_DynamicsCRM2

clearFormNotification

To remove Form Level Notifications we can use this method.

Syntax:

Xrm.Page.ui.clearFormNotification(uniqueId)
Parameter Name Type Description
uniqueId String A unique identifier for the message used with setFormNotification to set the notification.

Additionally, you can call out specific fields with the setNotification method. The code

Xrm.Page.getControl("fax").setNotification("This is a notification about the Fax field")

092315_1312_DynamicsCRM3.png

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