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 🙂
![[Step by Step] Beginner : Create a PCF control and add it to a custom page](https://rajeevpentyala.com/wp-content/uploads/2024/12/image-49.png)


Leave a reply to BRMD Cancel reply