Answered by:
picklist text value in plugin

Question
-
I am experimenting with plugins.
in my entity I have a picklist called new_service. what I am trying to do is get the text value selected into the plugin.
In the option sets I created a new option set 'service' with the following vlaues
1 - Car
2 - Bike
3 - Bus
all I seem to be able to get is the option number and not the text ie, bus, bike
Dim strService As String = String.Empty If entity.Contains("new_service") Then Dim SeviceOption As OptionSetValue = TryCast(entity.Attributes("new_service"), OptionSetValue) strService = SeviceOption.Value.ToString Else strService = "" End If
Dont ask me .. i dont know
Sunday, November 3, 2013 5:53 PM
Answers
-
You have to write another call to get option set text based on value. Please check following post :
http://consultrikin.wordpress.com/2013/07/02/crm-2011-c-get-optionset-text-from-optionset-value/
Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !
Vikram !- Marked as answer by Pete Newman Tuesday, November 5, 2013 1:05 PM
Monday, November 4, 2013 1:36 AM -
Hi,
I would suggest use XrmClient library to generate the Key /Value pair using CrmSvcUtil as explained here.
http://msdn.microsoft.com/en-us/library/gg695820.aspx
Else you need to use the second call as mentioned by Vikram.
Hope this helps.
-----------------------------------------------------------------------
Minal Dahiya
blog : http://minaldahiya.blogspot.com.au/
If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"- Marked as answer by Pete Newman Tuesday, November 5, 2013 1:05 PM
Monday, November 4, 2013 4:26 AM
All replies
-
You have to write another call to get option set text based on value. Please check following post :
http://consultrikin.wordpress.com/2013/07/02/crm-2011-c-get-optionset-text-from-optionset-value/
Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !
Vikram !- Marked as answer by Pete Newman Tuesday, November 5, 2013 1:05 PM
Monday, November 4, 2013 1:36 AM -
Hi,
I would suggest use XrmClient library to generate the Key /Value pair using CrmSvcUtil as explained here.
http://msdn.microsoft.com/en-us/library/gg695820.aspx
Else you need to use the second call as mentioned by Vikram.
Hope this helps.
-----------------------------------------------------------------------
Minal Dahiya
blog : http://minaldahiya.blogspot.com.au/
If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"- Marked as answer by Pete Newman Tuesday, November 5, 2013 1:05 PM
Monday, November 4, 2013 4:26 AM