[SOLVED] Validation in Editable Grids in Dynamics 365 Customer Engagement not working.



Blog Validation Thumbnail
Introduction
In this blog we will be discussing about the Business Rule validation issue in  Editable grids caused when the fields are not present in the views.

Scenario
In our demonstration we will take the example of a contact form and design a business rule to lock the email field if the Job Title field is blank. 

Implementation
Step 1: First we enable editable gird for the contact entity as shown in the image below

Editable Grid Configuration


Step 2:  Then we create a business rule for the contact form  to lock the Email field if the Job Title field is blank. The Business Rule is shown below

Business Rule

Step 3: Now in the editable grid we can see that the Email field is locked as the Job Title is blank.
Ediable Grid

The field is unlocked once the job title is entered
Email Field Unlocked


Step 4: Now we edit the criteria of the Business Rule and add a new condition to also check if the Description field contains data  as shown in the image below.

Business Rule


Step 5: When we go to the editable grid we see that even though the Job Title field is blank the Email field is unlocked which should have been locked.
No Job Title

Step 6: The reason behind this is that the My Active Contacts view does not contain the field description hence the validation fails.
Step 7: To solve this we add the Description column to the view as shown below.
Views
Step 8: Now if we check in the editable grid we see that the validation works correctly and the email field is locked.
Email Field Locked
Conclusion
This is important to be noted as , if there is some validation done using business rules, JavaScript  and field is not present in the views the validation wont work and there will be incorrect data entries made using the editable grid. 

Comments

Popular posts from this blog

Run Workflow directly from a button in Dynamics 365 Customer Engagement V9.0

Create and Associate Records in a single operation using Xrm.WebAPI in D365 Customer Engagement

Use Audit Logs in Dynamics 365 : Actionable Audit