Hi,
Below is the sample code to read Picklist value (i.e., OptionSet Value) in CRM 2011
if (context.InputParameters.Contains(“Target”) && context.InputParameters[“Target”] isEntity)
{
currEntity = (Entity)context.InputParameters[“Target”];
}
int statusValue = -1;
string statusText=string.empty;
if (currEntity .Attributes.Contains(“statecode”))
{
OptionSetValue optionState = currEntity .Attributes[“statecode”] as OptionSetValue;
statusValue = optionTimesheetState.Value;
statusText = optionTimesheetState.Text;
}
Hope it helps 🙂


Leave a reply to saddamk Cancel reply