Mar 03 2008
INSERT INTO StringMap won’t work for adding Picklist Values
The StringMap table is a handy source for selecting picklist values — but it’s essentially readonly. Picklist values are stored in the FieldXml field of the OrganiationUIBase table, as well as in the StringMap table. So if you insert into the StringMap alone, your values will be overwritten when you republish.
WARNING: The following is unsupported.
If you need to add a large number of picklist values, you’ll have to keep the two sources synchronized by doing the following:
- Export the entity containing the picklist attribute to which you want to add the values.
- Take a copy of the exported customizations to keep as a backup in case this breaks everything (always a risk with unsupported customizations… better yet, back up the CRM databases just in case.)
- Open the exported XML file in your favorite XML editor.
- Search for the attribute you want to update.
- Carefully add the attribute values following the formatting of the existing picklist values. (Should look something like the below XML.)
- Re-import the customizations.
- Publish the imported entity. (If this doesn’t work, publish all entities.)
<options>
<option value=”1″>
<labels>
<label description=”Sample Value 1″ languagecode=”1033″ />
</labels>
</option>
<option value=”2″>
<labels>
<label description=”Sample Value 2″ languagecode=”1033″ />
</labels>
</option>
</options>
-p