Answered by:
Picklist name in Database Table

Question
-
Dear all,
i am working in ms crm 4.0. can any one tell me, the picklist name is stored i which table?..
when we choose some picklist in crm form, it will e stored as integer value in table.can you tell me, in which table i can find the picklist name..
please help me..
Regards
ArunMonday, February 8, 2010 9:00 AM
Answers
-
All picklist names you can retrieve from StringMap view.
Truth is opened the prepared mind
My blog (english)
Мой блог (русскоязычный)- Proposed as answer by Andrii ButenkoMVP, Moderator Monday, February 8, 2010 9:06 AM
- Marked as answer by DavidJennawayMVP, Moderator Thursday, March 4, 2010 11:56 PM
Monday, February 8, 2010 9:06 AMModerator
All replies
-
I believe you want to get all the possible values along with the text for a picklist attribute. you can use the "MetaDataWebservice" for this purpose. you don't need to access the database.
http://msdn.microsoft.com/en-us/library/cc151047.aspx
here is an example on how to use "ReteriveAttributeMetaData".
The following example shows how to use the RetrieveAttribute message to reterive all the information about the picklist attribute.// Create an authentication token.
CrmAuthenticationToken token = new CrmAuthenticationToken();
token.OrganizationName = "AdventureWorksCycle";// You can use enums.cs from the SDK\Helpers folder to get the enumeration for AD Authentication.
token.AuthenticationType = 0;// Create the metadata Web service;
MetadataService service = new MetadataService();
service.Url = "http://<servername>:<port>/MSCRMServices/2007/MetadataService.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
service.PreAuthenticate = true;// Create the request
RetrieveAttributeRequest attributeRequest = new RetrieveAttributeRequest();
attributeRequest.EntityLogicalName = EntityName.contact.ToString();
attributeRequest.LogicalName = "picklistattributename";
attributeRequest.RetrieveAsIfPublished = true;RetrieveAttributeResponse attributeResponse = (RetrieveAttributeResponse)metadataService.Execute(attributeRequest);
// Access the retrieved attribute
PicklistAttributeMetadata retrievedAttributeMetadata = (PicklistAttributeMetadata)attributeResponse.AttributeMetadata;
See AlsoMonday, February 8, 2010 9:04 AM -
All picklist names you can retrieve from StringMap view.
Truth is opened the prepared mind
My blog (english)
Мой блог (русскоязычный)- Proposed as answer by Andrii ButenkoMVP, Moderator Monday, February 8, 2010 9:06 AM
- Marked as answer by DavidJennawayMVP, Moderator Thursday, March 4, 2010 11:56 PM
Monday, February 8, 2010 9:06 AMModerator -
Hi Andriy,
Thank you for your reply. As you mentioned, i found the table. its "StringMap" table.
Regards
ArunMonday, February 8, 2010 9:45 AM