Sonoma Partners Microsoft CRM and Salesforce.com Blog

CRM 2013 Form and Field Notifications

One of the many new features coming in CRM 2013 is the ability to dynamically display form and field specific notifications.  In CRM 2011 it was possible to leverage the form notifications using unsupported JavaScript but now in CRM 2013 there is a handy client-side method for this.  There are three different types of form notifications, error, information and warning which will determine the type of icon that is shown with the notification.  Below are examples of the new client-side methods and what it will look like on the new 2013 form.

Form Notification

Xrm.Page.ui.setFormNotification(“Form notification”)

  • Takes in a string value to set a form notification with the passed in string
  • Pass in “ERROR”, “INFORMATION” or “WARNING” to dictate the type of notification

image

To get rid of the form notification:

Xrm.Page.ui.clearFormNotification()

Field Notification

In addition to form notifications, CRM 2013 will add field specific notifications.  This is helpful if you have fields that will be dynamically required.  If a user sets a specific type and you want to require a field based on that type, you can set a notification to the newly required field to alert the user.

Xrm.Page.getControl("new_name").setNotification("Field specific notification")

image

To get rid of the field notification:

Xrm.Page.getControl(“new_name”).clearNotification()

Check back soon for more posts about new features in CRM 2013!