Hi,
I have a optionset value - 867400005
Now I want optionset lable or text of the option whose value is 867400005
Please help me to achive this
Thanks,
Hi Praajna,
There are some out-of-box messages that can be used in C# to retrieve the text of the option set.
Generally, you can use the RetrieveOptionSetRequest message to get the option set and its metadata, then from there filter out the options to the one with the desired value.
The option set metadata should contain a label for that specific option which you can then use.
Here's a blog outlining how to get the text of the option set:
https://thabisomotloung.wordpress.com/2015/04/16/get-optionset-text-using-c/
Another option, depending on your requirement, is if you leverage Early Bound Classes in your C# plugin, you can convert the associated enum based on the value to text, although this option removes all formatting from the text, for example: string statusReasonText = ((Contact_StatusCode)867400005).toString()
This would display, for example, the option "Needs Investigation" as "NeedsInvestigation" - the full name without the spaces/whitespace.
Hope this helps and gives you some direction!
Thanks!
Matt Bayes
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Eugen Podkorytov
106
Muhammad Shahzad Sh...
106
Most Valuable Professional