CRM Picklist and the StringMap Table (CRM 4.0)

If you have a look at the CRM base tables (eg: AccountBase) in MSCRM, you would notice that all columns of Picklist datatype seem to store Integer values. So from where exactly does CRM get the actual text value to be displayed on the UI?

Well, this comes from a not so well known table called ‘StringMap’. MSCRM stores all related option values for any picklist in this table.

Here’s the Structure of the StringMap Table:
Column Name
Primary ID of the record
Object Type Code of the entity
Schema Name of the picklist attribute
Integer value of the picklist option. This value is actually stored in the base tables.
Language Code
Organization ID
text value displayed within the picklist on the CRM UI
Order of the values in the picklist on the CRM UI
Last updated Timestamp (used during synchronization process)

Modifying the StringMap table to add new values is not recommended and can cause undesired results. In fact, CRM does not support modifying any of the CRM tables directly. All updates are to be made via the CRM UI or Web Services.

CRM seems to store picklist values in 2 tables:
1. StringMap
2. Metadataschema.AttributePicklistValue(This seems to be used as a temporary table)

Whenever an option value is added/edited/deleted for any picklist and saved from the UI, CRM updates theMETADATASCHEMA.AttributePicklistValue table. Upon publish of the Form the values are pushed into the StringMap table based on the values in the above table.
Hence directly updating the StringMap table via SQL with new values won’t suffice, since CRM will replace the values in DB with the new values when the Entity is published via the UI.
There are 2 possible ways to edit picklist values:
1. The Metadata Service (The only SUPPORTED way to add/edit/delete picklist values)
2. Modifying the Entity XML. (This requires editing the XML file for an entity)(UNSUPPORTED)Newly created values for any system picklist will have a value of 200000 or greater. This is to maintain backward compatibility during upgrades from CRM 3.0. This ensures that up to 199999 values for any picklist from CRM 3.0 will be successfully transferred during an upgrade to CRM 4.0
Note: Newly created values for any custom picklist would, however, start from 1.

Below is an example of both the options:

Option 1:

//Example for creating an option via the Metadata Service:
CrmLabel crmLabel = new CrmLabel();
LocLabel englishLabel = new LocLabel();
CrmNumber langCode = new CrmNumber();
// Set lang code as English
langCode.Value = 1033;
englishLabel.LanguageCode = langCode;
englishLabel.Label = “New Value”;
crmLabel.LocLabels = new LocLabel[] { englishLabel };
//Create the Insert Request
InsertOptionValueRequest insertRequest = new InsertOptionValueRequest();
//Set the Entity Name
insertRequest.EntityLogicalName =;
//Set the Attribute Name
insertRequest.AttributeLogicalName = “customertypecode”;
insertRequest.Label = crmLabel;
insertRequest.Value = new CrmNumber();
insertRequest.Value.Value = 200000;
//Execute the Insert Request
InsertOptionValueResponse insertResponse = (InsertOptionValueResponse)metadataService.Execute(insertRequest);
//Example for deleting an option via the Metadata Service:
//Create the Delete Request
DeleteOptionValueRequest deleteRequest = new DeleteOptionValueRequest();
//Set the Entity Name
deleteRequest.EntityLogicalName =;
//Set the Attribute Name
deleteRequest.AttributeLogicalName = “customertypecode”;
//Declare the Attribute Value
deleteRequest.Value = 200000;
//Execute the Delete Request
DeleteOptionValueResponse deleteResponse = (DeleteOptionValueResponse)metadataService.Execute(deleteRequest);

Option 2
Export the required entity. (MSCRM-Settings-Customization-Export Entities) OR use the ExportXmlRequest and ExportXmlResponse if you want to perform the export via web services.
Open the file within an XML Editor.
Search for the attribute schemaname you want to update.
You should find something similar to the text given below
<option value=”1″>
<label description=”Buyer” languagecode=”1033″ />
<option value=”2″>
<label description=”Seller” languagecode=’1033″ />
An additional option node would need to be created for every new option you want to add.
Eg :
<option value=”200000″>
<label description=”Re-Seller” languagecode=”1033″ />
</option>You can use the ImportXmlRequest/ ImportXmlResponse and PublishXmlRequest/ PublishXmlResponse classes to publish the xml back into CRM.