Using Keys to restrict duplicates in D365 CE

A superb way of restricting duplicate record creation is using Keys in Dynamics 365CE. This is definitely one of the most useful and easy to use features in Dynamics CRM.

In this example, I will create a Key for Email (emailaddress1) field to ensure there are only unique record values for this fields in my environment.

Create Key

It’s pretty straight-forward like creating any other Dynamics CRM component. Navigate to Keys under and entity like shown below –
createKey

And add a new Key and select attributes you want to use for that key
createdKey

Finally, save and publish your changes.

How it Works

Let’s say you already have an existing record ABC 1 with email address abc@abc.com
abc1.png

And if you try to create/update a record with the same attribute’s same value, you’ll get and error as below –
abc2

And the error will be
errorThrown

Hope this quick tip helps!

Advertisements