Bye Bye duplicate detection on create/update of a record in CRM 2013! But no!! I don’t want to say good bye! What do I do?
Duplicate Detection in Dynamics CRM 2013
UPDATED 07 June 2014: CRM 2013 Service Pack 1 has restored this functionality. Read about it here.
Here is another got’cha for CRM 2013 – especially for those customers upgrading from the previous version of CRM 2011 to CRM 2013. Here is what Microsoft says about duplicate detection for CRM 2013
“Duplicate detection during create and update operations will not be supported for Microsoft Dynamics CRM updated user interface entities. Duplicate detection of individual records won’t be supported for custom entities as well. However, to detect duplicates in bulk, you can use the ‘BulkDetectDuplicatesRequest’ message and the ‘RetrieveDuplicatesRequest’ message….”
That is, when you create/update e.g. a contact record, duplicate detection will no longer work even though you might have duplicate detection rules in place for the entity. From the new CRM 2013 UI, a user can trigger duplicate detection via a bulk duplicate detection job that a user sets up.
More importantly, duplicate detection will also not work when you are:
- merging two records,
- converting a lead,
- activating/deactivating a record,
- saving a completed activity.
Interestingly, you can still create duplicate detection rules as of old. They just don’t work for the above scenarios. They do, however, work for the following scenarios:
- Bulk duplicate detection job
- CRM for Outlook goes from offline to online (synchronisation)
- During data import (Import Data wizard detects any duplicate records)
The detail straight from Microsoft is here.
I’m not sure if there is an official explanation from Microsoft as to why they removed the duplicate detection functionality for creation/update of records, but my guess is that duplicate detection on e.g. update of an entity record, interferes with the auto-save functionality Microsoft introduced to CRM 2013.
Closer Look at Duplicate Detection on CRM 2013
Out of the box CRM 2013 contains some default duplicate detection rules which you can find in Settings > Data Management > Duplicate Detection Rules.
For example, I have deliberately created two accounts with the same “Account Name”, namely Navy House Ltd. No warning was triggered when I created the second record. Once the two duplicate records are created, you can set a bulk duplicate detection job on Accounts by clicking on the eclipse and you will see an option to “Detect Duplicates”.
Choosing the option “For All Records on All Pages” will automatically generate a system job of which you can specify the start time. To find the status of this job, go to Settings > Data Management > Duplicate Detection Jobs. Open the record and click on “View Duplicates”; this will show you the number of records identified by CRM as duplicates. The user will then have to make some decision on how to deal with the duplicate records, e.g. bulk delete, merge etc.
What Are We To Do Without Duplicate Detection For Creation/Update Of Records?
Before we all run screaming in panic, read on … luckily the open source community came to the rescue. I am aware of the following solutions to try to bridge the “gap” in this duplicate detection saga.
The first is an example in the CRM 2013 SDK (download it here). The relevant sample code is in “SampleCode\JS\DuplicateDetection”. SyedHussain has provided detailed instruction on how to import the solution here.
The second solution was released by Jason Lattimer on Codeplex. It is this second solution that I will be testing below.
CRM 2013 Duplicate Detection Solution on CodePlex By Jason Lattimer
When I now create an account record via the “NEW” button (top left) on the account form, the duplicate detection screen in Jason’s solution pops up as expected.
However, if you install this solution and your organization has the auto-save function turned on (as is the default in CRM 2013), the side effect here is that if I modify an existing account record so it has the same account name as another account record, the modified form will first warn you there are unsaved changes to the account form. After 30 seconds, auto-save will fire to try to update this modified account form and Jason’s duplicate detection screen pops up again.
So it seems that if you want duplicate detection to function properly without triggering every 30 seconds in CRM 2013, you will need to turn auto-save off. If, like me, you don’t want to turn form auto-save off, you will have to stick with scheduling bulk duplicate detection jobs for now.