When working with the Dynamics CRM SDK, I think we may all overlook a very handy property that can save us a lot of time:Tthe FormattedValues property.
It contains values formatted in the human-readable version of field types such as:
- Option Sets (including State and Status Reason fields)
Here is an example of the Formatted Values for a Contact (as seen from the Visual Studio Watch window):
Like any collection of values returned from CRM, you will need to verify that the field name exists in the collection using the .Contains operator, but once you have, you can extract the formatted value for use in your own code.
Note: Formatted values are always strings, which is how they are displayed in the CRM user interface.
Anyway, just a quick note to refresh your memory. Have fun coding.