检索在选项集字段中选择的值,并在文本字段中显示ita值

问题描述:

有人可以帮助我在文本字段中显示选项集字段值吗?我想检索在选项集中选择的值,并使用插件在文本字段中显示该值.Iam在案例"实体的更新"上编写此插件...

Could any one please help me in displaying an optionset field value in a text field..? I want to retrieve the value selected in optionset and display the same in a text field using plugin.. Iam writing this plugin on "update" of "case' entity...

获取选项设置值:

int value = ((OptionSetValue)entity["yourattributename"]).Value;

获取文本:

String text = entity.FormattedValues["yourattributename"].ToString();

在上面的代码中,实体是Entity对象,将从中检索选项集值/文本.请用您的情况替换属性名称.

In the above code entity is the Entity object from which the optionset value/text to be retrieved. Please replace the attribute name with your case.