I have retrieve a value using a Odata call and have found the Option Set Value ~ 12344
I am trying to set field with the TEXT which is associate with Option Set Value.
var chsAccountEntity = RetrieveServiceD.results[0];
alert(AccountEntity.LegalEntityState.Value);
var optionValue = chsAccountEntity.fieldName.Value; // return 12344 ok
alert(optionValue);
var TextOption = Xrm.Page.getAttribute(“fieldName”).getOption(optionValue);
alert(TextOption.text);
var label = TextOption.text;
Xrm.Page.getAttribute(“fieldName”).setValue( label);
after running this code I am receiving the following Error:
the field should have the text Colorado
What am doing wrong?