Search code examples
csvimportdynamics-crmlookup

Microsoft Dynamics Data Import Failing with Unresolved Lookup


I'm attempting to import a csv file in Microsoft Dynamics 2011. The file is an export of sales data from our website and I'm attempting to create new Account, Contact, Invoice, Order, Invoice Product and Order Product entities using this data. I'm using a multi-entity data map to do this.

When I attempt the import however, creating the invoice fails with the message "The lookup reference could not be resolved." in connection with the currency field. This field is a lookup tied to currency name which in all cases is "US Dollar". This is exactly the same name as the USD currency in our database, but for some reason the lookup refuses to assign it correctly. There are no other currencies in our database with this name.

Can anyone offer me an explanation as to why this is happening and any steps I can take to deal with it? Many thanks.

EDIT: More information about my problem.

It seems that problems occur when I try and perform a multiple entity import with duplicates. All the new entries I'm creating from this import is dependent on other new entries created with the same data. I'm creating accounts, then creating customers to assign to those accounts for example. If said accounts have duplicates already in the system, they are ignored. This is expected. However, when it comes to create the customer assigned to that account, the lookup fails with a "Duplicate lookup reference was found" error. This error occurs when there are more than one things in the database that fit the value I'm using with the lookup.

I'm not 100% sure, but I think it's counting both the account that was ignored and the original account that's already in the system when performing the lookup. Can anyone offer more insight on how I might work around this?


Solution

  • I don't know for sure if this is your issue but my guess it is.

    In the import wizard you can select how he resolves your lookups. i.e: when in your CSV file the column contains the name of the currency you will have to select the name field in your import wizard for the currency field.

    In the screen here you can see then country is a lookup and the name of the country is the value of CSV file. It must match the field of the lookup. If I select "created on" It doesnt find the lookup. because no country exists where created on equals "Belgium". So you select the Name field of the lookup and that is how he will check your value in the CSV in the lookup field you defined.

    Lookup Reference

    1.Put records for each record type in a separate file.

    2.Put records for different owners in a separate file.

    3.Ensure that the first line of the file contains column headers and that they match the CRM attribute display names EXACTLY if you would like the import wizard to automatically* map the data. *Automatic mapping is required if you intend to import records that are related to another record (See #6). I HIGHLY RECOMMEND USING AUTOMATIC MAPPING EVEN IF YOU DO NOT DESIRE RELATED RECORDS.

    4.Make sure the first column heading is not the name of a record type.

    5.Make sure data exists in your source file for all CRM required fields (denoted with a red asterisk on the CRM form).

    6.Make sure some data exists for each column. If a column has no data delete the column.

    7.If your data should be related to another record (i.e. Adding Contacts to existing Accounts) make sure the column header matched the CRM lookup attribute display name. If you have two different attributes in CRM with the same display name you will receive an error (EX. if you created a custom State picklist value to replace the text version and keep the display name the same "Address 1: State/Province"). Also make sure the company name values will match a corresponding account record (i.e. contacts with a Parent Customer value of Microsoft Corp. will not be added to the CRM Account Microsoft) and that there are no duplicate Accounts in the system as the import will not be able to resolve the proper Parent Customer.

    8.If you are importing into a drop-down list, ensure all the values exist within CRM and there are no typographic errors and consistent capitalization in the source file.

    EDIT: It seems like indeed there are multiple records in your DB that can fit in that 1 lookup. it's normal that he gives an error on this as he can't resolve the lookup. The CRM doesn't know which record to take. Also you might want to watch out if you are importing a M-N Relationship. You will have to do a M-N Relationship with code. The standard import wizard cannot handle Many-to-many relationships