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

Removing an Option-Set value from the Option-Set onSave event, appears to clear the data contained.

$
0
0

Hello All,

Option set value is getting clear if we remove the specific option from it.

example: In Case form we have status reason field, on save of a case we are changing the status reason for the record. If the record's status reason say "Submitted" then we want to remove "Assigned" status reason from option set which we are doing via jscript but, it's clearing the current value of option set too.

var control = Xrm.Page.getControl("statuscode");
var status = Xrm.Page.data.entity.attributes.get("statuscode");
if (status.getValue() == '950000017') {
       control.removeOption(950000021);
      Xrm.Page.getControl("statuscode").setDisabled(true);
}
else {
     control.removeOption(950000017);
     Xrm.Page.getControl("statuscode").setDisabled(false);
}


Viewing all articles
Browse latest Browse all 46379

Trending Articles



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