Duplicate Lookup Reference Was Found - {Quick Tip}

Introduction


While importing data into Dynamics 365 with lookup fields, sometime we get a duplicate reference found error. If you are getting same error then here is a quick tip for you.
 

Details


While we are importing data into Dynamics 365 CE with 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 parent entity, for example if we are referring account lookup, we can use account number instead of account name like below
 
Duplicate lookup reference was found - {Quick Tip}
 
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.
 
Duplicate lookup reference was found - {Quick Tip}
 
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. To make sure to check active as well as inactive records to remove duplicate records.
 
Hope it will help someone!

Keep learning, Keep sharing!!


Next Recommended Reading How to Create Custom Lookup View in CRM