Wednesday 6 November 2019

D365 CE - Duplicate detection approach and options



Hello All,

It feels great to be back with an interesting topic around duplicate detection and approaches.

Duplicate detection is essential to maintaining data integrity and quality in any system and when it comes D365 though there are multiple options to achieve this we are going to concentrate on the following four

1. Duplicate Detection Rules

Duplicate detection rules are out of the box way to manage duplicates. The same can be configured at the UI level.
  • Not enforced and users can override optionally
  • Works within current users access, so there is a chance that duplicates beyond current users access are not considered
  • Needs to be specified explicitly while creating records via OrgService/WebApi

2. Alternate keys
MSCRM alternate Keys are handy in performing duplicate detection and the alternate keys are primarily used for simplifying Integration and Migration activities. Beyond that, it implements a unique constraint for one column or combination of columns.

  • Robust and applies across the board. No need for impersonation
  • Covers UI, Import, OrgService and WebApi
  • Allows null values and duplicate detection is not applied here
  • It also can be used for upsert, retrieve, update and delete. 
  • Errors are system defined and cannot be customized
3. Plugin/Workflow
We can write our own logic to detect and avoid duplicates using plugin and workflows.
  • Allows custom error messages
  • Provides better control on duplicate detection logic
  • Covers UI, Import, OrgService and WebApi
  • Works within the current user's access, so there is a chance that duplicates beyond the current user's access is not considered. Needs impersonation.
4. JavaScript
Like plugin, we can achieve this using a simple JavaScript but the same has its own limitations
  • Covers only UI
  • Allows custom error messages
  • Provides better control on duplicate detection logic
  • Works within the current user's access, so there is a chance that duplicates beyond the current user's access is not considered. Needs impersonation.



1 comment: