Introduction

In Dynamics 365 CRM to show form notifications of type, JavaScript was used .As an example, Form Notification form and Form Notification entity record are used to set show form notifications using setFormNotification.

Step 1

We must log in to Dynamics 365 and go to Settings — Solutions

Step 2

Choose any solution you have developed, and either create an entity of your choosing or use one that already exists

Step 3

Open the Solution and Go to Entity.  Enter into a Form Properties,

Step 4

Create a web resource with the below code.

function Notification(executionContext)
{
var formContext = executionContext.getFormContext();
if (formContext !== null && formContext != ‘undefined’) {
var Pradeep = formContext.getAttribute(“pradeep_deepu”).getValue();
console.log(‘Pradeep-‘ + Pradeep);
formContext.ui.setFormNotification(Pradeep + ” : INFORMATION notification.”, “INFO”);
formContext.ui.setFormNotification(“Mobile Phone number not filled – Warning notification.”, “WARNING”);
var Komara = formContext.getAttribute(“pradeep_nani”).getValue();
console.log(‘Komara -‘ + Komara );
if (Komara == null) {
formContext.ui.setFormNotification(“Komara Mandatory- Error notification.”, “ERROR”);
}
}

}

Step 5

change the above code based on your requirements and add it to the field properties.

Step 6

Now Publish the changes.

Next, Go to the app and test the changes.

Step 7

Nani – No title which Error Notification at the top.

 

For any Help or Queries Contact us at info@crmonce.com or +918096556344