How to get the option set from a field in an entity in CRM 2011 using crm sdk and C#

后端 未结 5 582
闹比i
闹比i 2020-12-18 09:05

How to get the option set from a field in an entity in CRM 2011 using crm sdk and C#? I just want to share with you guys a direct approach on getting the option set of a fie

5条回答
  •  温柔的废话
    2020-12-18 09:14

    Hey why not use this ??

    OptionSetValue CountryOptionSet = Contact.Attributes.Contains("gr_address2_country") ? Contact["gr_address2_country"] as OptionSetValue : null;
     if (CountryOptionSet != null)
                         string Country = CountryOptionSet.Value.ToString();
    

提交回复
热议问题