RetrieveAttributeRequest request = new RetrieveAttributeRequest();
request.EntityLogicalName = targetEntity.LogicalName;
request.LogicalName = optionsetLogicalName;
request.RetrieveAsIfPublished = true;
RetrieveAttributeResponse response = (RetrieveAttributeResponse)service.Execute(request);
PicklistAttributeMetadata picklist = (PicklistAttributeMetadata)response.AttributeMetadata;
var query = from option in picklist.OptionSet.Options
where option.Value == int.Parse(Statusvalue.ToString())
select option.Label.UserLocalizedLabel.Label;
SselectedOptionSetlLabel = query.FirstOrDefault().ToString();
request.EntityLogicalName = targetEntity.LogicalName;
request.LogicalName = optionsetLogicalName;
request.RetrieveAsIfPublished = true;
RetrieveAttributeResponse response = (RetrieveAttributeResponse)service.Execute(request);
PicklistAttributeMetadata picklist = (PicklistAttributeMetadata)response.AttributeMetadata;
var query = from option in picklist.OptionSet.Options
where option.Value == int.Parse(Statusvalue.ToString())
select option.Label.UserLocalizedLabel.Label;
SselectedOptionSetlLabel = query.FirstOrDefault().ToString();
No comments:
Post a Comment