Notes on software development.
Mostly .NET, C# and game development using XNA.

Sep 11, 2013

Microsoft CRM 2011, import CSV file with entity references (lookups)

While most of the time you probably could use a LookupMaps to set up an entity references in you import maps, you may come to situation there you want put actual ID's (references) in your CSV file. So, the tricky part here is the format. To create EntityReference you need entity type name and it's GUID. How would you put that into CSV string? The answer is like this:

2 comments:

Unfortunately, this does not work in CRM 2011. Instead, you have 2 options:(1) you need to provide the display value associated with the lookup. If the display value is not unique, the import will fail.(2) you provide the GUID without the 'entity_type_name'. During the import, when you map the lookup field, do not map to the name field. Instead, use the lookup icon, to map to the primary key field. Have a look at this post http://exploringxrm.wordpress.com/2012/05/08/resolving-duplicate-lookup-references-in-import-process/