Microsoft Dynamics CRM has the ability to map fields between entities so when you create a new record, values from the parent can be copied, easing data entry. For instance if you create a new Contact associated with an existing Account, the address and phone fields are copied from the Account to the new Contact record. Picklists however, represent a unique issue when mapped. Picklists are displayed as a list of string values, i.e. the picklist field Color may have the values Red, Green, Blue, & White in the list. But those string values are not maintained in the record. Each string value has an associated numeric value that is actually what is stored in the data. That numeric value points to the proper string in another database table called the String Map. When you map a picklist, only the numeric value is copied. The system depends on the values in the String Map to be the same for each entity. But often they are not. For instance if we had created our Color picklist in the parent entity as Red, Green, Blue and then White, the associated values would be Red = 1, Green = 2, etc. But if in our related entity we added the colors in a different order, say White, Red, Green, and then Blue, then White = 1, Red = 2, etc. So now, if I create a new record and the mapped Color field has a display value of Red, then the new record will display a value of White instead because the numeric value of 1 was copied and 1 = Red in the source but equals White in the target. So we have to be sure our picklists match up. Not a big deal if you have a few items like our short Color field. But what if you have a lot of items in a picklist? You want to be sure that the picklist in both entities is the same. This can be a real labor intensive chore!
A student in a recent CRM 4.0 Customization course I taught was in that predicament. They had a number of picklist fields that they needed to map between entities and doing so manually was a lot of work. He wondered if there was a better way. So I queried the other CRM MVPs to see if any of them had a way or a tool. I found both.
Joel Lindstrom, Customer Effective, http://blog.customereffective.com/blog/joel.xml, offered this suggestion. I’m copying his words for you:
Here’s how I do it, kind of manual, but it works.
Create the picklist in the first entity with all of the values. Create the picklist in the second entity, give it one value. This can be anything you want, like “Larry”.
Export the customizations individually for both entities and open entity 1 customizations in notepad or some other editor. Find the picklist and values in the XML. Usually do this by searching for one of the picklist values, then copy everything between the <options>, such as:
<label description=”Simple” languagecode=”1033″ />
<label description=”Notify” languagecode=”1033″ />
<label description=”Data Administrator” languagecode=”1033″ />
Then open the customizations for entity 2. Search for “Larry” or whatever you named the picklist value. Paste in the picklist options between the <options> Then import customizations for entity 2.
I haven’t actually tried this yet but I intend to shortly. I need to decide exactly what I want in my picklists first. MVP Matt Parks also offered a similar suggestions so must be a good method.
Microsoft Regional Director David Yack offered another suggestion. In his recent book, “XRM as a Rapid Development Platform”, www.TheCRMBook..com, he describes a tool he developed called Attribute Replicator. It’s in Chapter 8 of his book and the companion sample code. I haven’t had a chance to check it out yet but intend to do so. I’ll blog it when I do.