Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Setting attribute with value from Option Set value with label

$
0
0

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?
                           


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>