Hi experts,
I have created the following HTML web resource:
I have created this to substitute for multi select option set as the requirement is to view all values without having to click on the field and populating.
I have applied this code to save the selected values:
function setListOnSave() { //remove all SC Option set values Xrm.Page.getControl("new_os1").clearOptions(); //Get all values of First div (Software Configuration) all check box value using class name SC var SC = Xrm.Page.getControl("WebResource_MultipleSelect").getObject().contentWindow.document.getElementsByClassName("SC"); var tmp=null; for(var i=0;i<SC.length;i++) { if(SC[i].checked) { //getting label of checked check box tmp+="-"+SC[i].value; //setting checked check box value into option set var opt1 = new Option(); opt1.text = SC[i].value; opt1.value = 100000000+i; Xrm.Page.getControl('new_os1').addOption(opt1); } } }
Now, when I return to some record, it doesn't show the values that I had selected previously and again displays the checkboxes as empty.
Am I going wrong somewhere? Do I have to make an addition to my code?
Thanks!
Jon
*This post is locked for comments