locked
how to set optionset value - Microsoft dynamics crm 2011 RRS feed

  • Question

  • Hello,

    I want to retrieve dropdown (OptionSet) value (text value) into my grid.

    I tried by following code..

    if (dsr.Attributes.Contains("new_objectiveofvisits"))
                        {
                            dr["Objective of Visit"] = ((EntityReference)dsr.Attributes["new_objectiveofvisits"]).Name.ToString();
                        }

    It gives me error something like OptionSet can not be cast by EntityReference.

    I have done using EntityReference before but it gives me error now.

    What to do? Please help !!!

    Monday, July 16, 2012 8:25 AM

Answers

All replies