Duplicate Detection in Dynamics 365

Hello Guys,

In my previous blogs we have seen Plugins Series in Dynamics 365 where we covered Plugins development from the scratch. I hope you are able to develop and deploy dynamics plugin very easily. Today we will see Duplicate detection in Dynamics 365. But before if you are new to our blog then do follow us to know more about Dynamics and Power Platform. Also if you like our blog then please comment and share this blog with your friends.

As we are using Dynamics 365 for our business solution we have faced duplicate records many times. As being a developer we need to maintain integrity of data and we have used some JavaScript or Plugin implementation to avoid duplicate records creation in Dynamics 365. However to identify unique records in dynamics crm we have entity or record id which is in the form of GUID, but we have scenarios where we need to think for data contained by field.
For example, Consider Employee entity which contains FirstName and LastName attributes. 

Sr. No First
Name
Last Name

1

Achint

Gupta

2

Achint



Gupta

3

Tanaka

San

4

Tanaka P



San

5

Sameer

Chatale

In the above table you can see we have some duplicate records. It may be possible we will have two or more employees whose first name and last name would be same. Well to distinguish them we should be having some parameter. For example, Middle name. In above table we have "Tanaka" and "Tanaka P" but it may be possible when middle name can also be same. In this situation you will be using sequence like Tanaka1, Tanaka2 and so on...

We can write a java script code or plugin code for restricting duplicate records. But Dynamics 365 having one out of the box solution for the same and which is Duplicate Detection Rules.

We can create rules for the entity based on their attribute to identify duplicate records. Below are the steps for implementing Duplicate Detection.

Step 1:- Enable duplicate detection for the entity. You can enable this by checking duplicate detection check box while creation of the entity.



Step 2:- Enable duplicate detection settings. You can enable this by navigating
Settings -> Data Management -> Duplicate Detection Settings.



Step 3:- Create duplicate detection rule. Navigate to Settings -> Data Management -> Duplicate Detection Rules.



As you can see different duplicate detection rules are setup already in your system. we will be creating our own rule.

Step 4:- Click on New to create a new rule. Fill the information as shown below:



Here,

we have checked “Ignore Blank Values”, because, if a employee does not having first name or last name, they will show up as the same employee in your data set.

Also we have checked  “Exclude Inactive Matching Records”,because if you have a former employee, for example, and they start working with you again, and you check this box, you will not have access to any historical data and have to fill in their information all over again.

Step 5:- Save the Rule by clicking save button. Once rule is created, click on Publish button on the top to publish this rule. 

So now our rule is ready and published. we will be checking it is working or not. Now you can see we have employees in below image.



We will be creating a new employee with same details for example, We have one employee record with first name and last name i.e. Priyanka Harpale.

So now click on new. Insert first name and last name and click on save. You will see one pop up window as below.



You can click on cancel to modify data or can click on ignore and save to keep duplicate data.

Hope it helps...





Comments

Post a Comment

Popular posts from this blog

Read Only Sub Grid & Editable Sub grid in Dynamics 365

Using Pipelines in Power platform for deploying solutions to environments.

Understanding Sales Process in D365.