Hi,
I have a requirement to setup depending optionset.
Optionset 1 has
1. Fruit
2. All
Optionset 2 has 10 values. If I click fruit, it removing 5 non-fruit values, it is ok. but when I click again All, it not reseting all default values, until I have to refresh the page.
My Script is
function removeoptions() {
var options = Xrm.Page.getAttribute("new_optionset1").getValue();
var defauktvalues = Xrm.Page.getAttribute("new_optionset2").getValue();
if (options == 1) {
Xrm.Page.getControl("new_optionset2").removeOption(5);
Xrm.Page.getControl("new_optionset2").removeOption(6);
Xrm.Page.getControl("new_optionset2").removeOption(7);
Xrm.Page.getControl("new_optionset2").removeOption(8);
} else if (options == 2) {
Xrm.Page.getAttribute("new_optionset2").setValue(defaultvalues);
}
Appreciate your help. thanks
*This post is locked for comments