10 May’17

D365 GeneralAdd Notification method in Dynamics 365 forms


In this blog, we are going to discuss the new feature of Dynamics 365 for form and field Notifications.

The new method basically provides similar functionality like recommendation action in Business Rule.

Method: addNotification

This method displays an error or recommendation notification for a control. Based on the notification option selected specify actions. On Dynamics 365 mobile clients, tapping on the icon will display the messages you specified and two standard buttons: Apply and Dismiss. Clicking Apply executes the action you define; clicking Dismiss closes the notification message.

Note: Setting an error notification on the control will block the saving of the form, setting a recommendation notification will not block the saving. By default, the notification level is set as ERROR if not specified.


  • Messages- (Array) The message that we want to display to user
  • Notification Level- (String) Specifies if we want to display error or recommendation
  • Unique ID- (String) Unique ID for notification
  • Actions-(Array of Objects) Corresponding actions for the message

Let’s implement a simple scenario. Based on the account type selected, the ticker symbol will be populated. If the account type is “Channel Partner User” than set the ticker symbol as “CPU”

We can create a web resource and use following code:

var AddTickerSymbolRecommendation = function () {
var typeOfAccount = Xrm.Page.getControl('xcd_typeofaccount');
var typeOfAccountValue = Xrm.Page.getAttribute('xcd_typeofaccount').getValue();
var tickerSymbol = Xrm.Page.data.entity.attributes.get('tickersymbol');
if (typeOfAccountValue == 1 && tickerSymbol.getValue() != "CPU") {
var actionsCol = {
message: 'Set the Ticker Symbol to CPU? ',
actions: null
actionsCol.actions = [function () {
messages: ["Set Ticker Symbol"],
notificationLevel: "RECOMMENDATION",
uniqueId: '2002',
actions: [actionsCol]

Bind this code on change of Account type field. When user selects Channel Partner User it will show an information icon like following:

When you click on the recommendation icon, you get a pop up to select Apply or Dismiss:

When you click Apply respective actions are performed:

Written by

Krishna Bhanushali

Software Developer

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Reading more then 10K records in D3FOE OData API

    11 July’ 2018

    Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time usi...

    Read more
  • Paging in D365 Customer Engagement v9.0

    10 July’ 2018

    Introduction: The Xrm.retrieveMultipleRecords method is used to retrieve a collection of records in Dynamics 365 Custom...

    Read more
  • Set up Dynamics 365 connection in Microsoft Social Engagement

    10 July’ 2018

    Introduction: This blog explains how to Set up Dynamics 365 connection in Microsoft Social Engagement. Steps to be follo...

    Read more
  • Voice of the Customer failed to install

    10 July’ 2018

    Introduction: Many people face issues in installing Voice of Customer solution on v9 environment and trying repeatedly ...

    Read more
  • Scribe Insight AX as a Web Service Find Block issue

    10 July’ 2018

    Introduction: If we need to look up for any value from AX then we do it by using a Find Block in Scribe Insight Eg: Basi...

    Read more