Dynamics CRM - Duplicate Lookup Reference
Introduction
While importing data into Dynamics 365 with lookup fields, sometimes we get a duplicate reference found an error. If you are getting the same error then here is a quick tip for you.
Details
While we are importing data into Dynamics 365 CE with a lookup field, Dynamics tries to relate lookup records based on the primary field name by default.
So if you have two records with the same name, you will get the error “A duplicate lookup reference was found” because CRM is not sure which record you want to relate with your current record. If you have duplicate records, you can use the following options to avoid this error and tell CRM specifically which record you want to associate.
Using some unique field from the parent entity, for example, if we are referring account lookup, we can use account number instead of account name like below

Using GUID of the record in the column field.
But if you don’t have any duplicate record and you are still getting this error, make sure to recheck your inactive records as well.
This is because if you have any duplicate records which are inactive CRM will consider it as a duplicate record. You can delete this record or rename it to something else to avoid this error.
Summary
You may have some hidden inactive records which are causing this issue. Make sure to check active as well as inactive records to remove duplicate records.
Keep learning, Keep sharing!!
Comments
Post a Comment