MS CRM2011 获取某个实体的某个Picklist属性的所有值

string entityType = "crm_channel";
string attributeName = "crm_channel_type";
RetrieveAttributeRequest retrieveAttributeRequest = new RetrieveAttributeRequest
{
  EntityLogicalName = entityType,
  LogicalName = attributeName,
  RetrieveAsIfPublished = true
};
RetrieveAttributeResponse retrieveAttributeResponse = (RetrieveAttributeResponse)new Method().Execute(retrieveAttributeRequest);
PicklistAttributeMetadata retrievedPicklistAttributeMetadata = (PicklistAttributeMetadata)retrieveAttributeResponse.AttributeMetadata;
OptionMetadata[] optionList = retrievedPicklistAttributeMetadata.OptionSet.Options.ToArray();

转载于:https://www.cnblogs.com/lmy213/archive/2012/08/09/2630417.html

你可能感兴趣的:(MS CRM2011 获取某个实体的某个Picklist属性的所有值)