Monday, 2 November 2015

Get Option Set String from CRM 2011/2013/2015 in C#

Hi,

Most of the times, CRM developer in CRM goes to check Option Set value only finds out the value as integer.

At times, we get a requirement to get string value associated with the integer.  For doing this, we write a metadata call and as we all know metadata calls are more time consuming.

As always, CRM is smart just we need to find the correct approach.

When we retrieve the entity, we can always the string of the option set by using the following line.

string strOptionSetText = objEntity.FormattedValues["<OptionSetSchemaName>"];
Hope this helps.
--
Happy CRM'ing

Gopinath 

No comments:

Post a Comment