10 May’17

Dynamics 365, EnterpriseAdd 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

  • Dynamics 365 Client Diagnostics

    15 March’ 2018

    Main cause of Performance Issues: Bandwidth and latency are the primary characteristics which affects the performance o...

    Read more
  • Closing Blind Shift in MPOS and CPOS in Dynamics 365 for Retail

    15 March’ 2018

    Manual For closing Blind shift in POS: Blind shifts terminate the currently ongoing shift and when logged in a new shif...

    Read more
  • Persistent Filters in the Power BI Service

    13 March’ 2018

    Introduction: The feature is finally release, and it is power BI has announced general availability of persistent filt...

    Read more
  • Cause and Solution for Scribe MSMQ not receiving Message from AX

    10 March’ 2018

    Issue: Microsoft Message Queuing (MSMQ) service running on Server might be unable to receive messages. Therefore, messa...

    Read more
  • User Privileges on SharePoint – D365 Document Integration

    10 March’ 2018

    Overview: Often, we wonder what could be wrong where we see a generic error on Documents in Dynamics 365. Something lik...

    Read more