Tip #927: Duplicates when merging

When you merge two records you may receive the following cryptic message:

A record that has the attribute value {1} already exists. The entity key {0} requires that this set of attributes contains unique values. Select unique values and try again

What? Select where? That’s really confusing because the merge process is supposed to ignore the duplicates because one of the records is being deactivated.

Lucky for us, it’s not a generic SQL error and the answer is the mentioning of the entity key in the message. It refers to an alternate key that exists on the record. When alternate key is present, the unique index is created by SQL Server and that index trumps any business layer rules and duplicate detections that Dynamics 365 might have in place.

Effectively, you will receive the above message when you’ve selected the alternate key value from the subordinate record and are trying to merge it into the master record. Subordinate record will be deactivated but the value of the alternate key still there (and in the index) so any attempt to add the same value in the master record breaks the merge process.


  • Manually remove the value from the alternate key from the subordinate record and add it to the master.
  • “Swap” master and subordinate and merge into the record that contains the correct key value.


Leave a Reply

Your email address will not be published. Required fields are marked *