Mar 03 2008

INSERT INTO StringMap won’t work for adding Picklist Values

Published by Phil at 8:00 pm under Customization, Unsupported, gotchas

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:

  1. Export the entity containing the picklist attribute to which you want to add the values.
  2. 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.)
  3. Open the exported XML file in your favorite XML editor.
  4. Search for the attribute you want to update.
  5. Carefully add the attribute values following the formatting of the existing picklist values. (Should look something like the below XML.)
  6. Re-import the customizations.
  7. 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

5 Responses to “INSERT INTO StringMap won’t work for adding Picklist Values”

  1. kennethwsmithon 19 Apr 2008 at 7:44 am

    Nice site so far, keep up the posts!

  2. Philon 19 Apr 2008 at 1:51 pm

    Thanks!

  3. Bryanon 13 Jan 2009 at 10:05 am

    Phil, Great site! Regarding the “INSERT INTO StringMap won’t work for adding Picklist Values” post - is it correct to assume that in addition to updating the values in the exported XML you have also updated the values in the stringmap table?

    I have a client that had updated the Account Industry drop down list many months ago (with many additions and omissions along the way) and now would like the same drop down list in the Contacts entity (with matching indices) so I was going to go ahead and update the table and then do what you’ve suggested - should be good right?

  4. Philon 13 Jan 2009 at 10:08 am

    Bryan,

    Thanks! Good question — no, if I remember correctly, you DO NOT have to also update the values in the stringmap table. When you import customizations, the stringmap table will be auto-updated.

    Yes, should be good, but do it in a Test environment first if possible! A little screw up can cause headaches down the road with unsupported tricks, generally.

  5. Bryanon 13 Jan 2009 at 10:15 am

    Phil,

    Will do - thanks for the quick reply and again - great website!

    Bryan

Trackback URI | Comments RSS | del.icio.us | Digg it | Furl | iFeedReaders | Wykop

Leave a Reply