Microsoft Dynamics CRM

{Dynamics 365 Enhancements} Add Notification Recommendations to your Entity forms using script

This blog is part of the series which I will use to cover all interesting enhancements coming in Dynamics 365.

Scenario: On Account form, if user fills in the Telephone field – suggest a recommendation to set Contact preference by Phone field. If user selects yes, set Contact by Phone option to allow.

Scenario by Graphics:

· On change of phone field, CRM shows a recommendation tooltip:


· When you click the information icon, CRM gives you a recommendation:


· If you pick Apply, CRM will do the updating to the field as required:


Great isn’t it?

Here is the link describing the new Client side scripting function:

And here is the script for this one (Register it on change event of Phone field):

function addPhonePreferenceNotification() {

var myControl = Xrm.Page.getControl(‘telephone1’);

var telephone=‘telephone1’);

var phonePreference =‘donotphone’).getValue();

if (telephone.getValue() != null) {

var actionCollection = {

message: ‘Set the Contact Preference for Phone to Allow?’,

actions: null


actionCollection.actions = [function () {‘donotphone’).setValue(false);




messages: [‘Set Phone Preference’],

notificationLevel: ‘RECOMMENDATION’,

uniqueId: ‘my_unique_id’,

actions: [actionCollection]




console.log(“Notification not set”);

}// JavaScript source code

Hope it helps and Happy CRMing!

Check this out




Google Play Store:


2 thoughts on “{Dynamics 365 Enhancements} Add Notification Recommendations to your Entity forms using script”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your 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