function setOptionSetValueByText() {
var optionText = Xrm.Page.getAttribute("statuscode").getText();
var options = Xrm.Page.getAttribute("new_status").getOptions();
for (i = 0; i < options.length; i++) {
if (options[i].text == optionText) {
Xrm.Page.getAttribute("new_status").setValue(options[i].value);
}
}
}
var optionText = Xrm.Page.getAttribute("statuscode").getText();
var options = Xrm.Page.getAttribute("new_status").getOptions();
for (i = 0; i < options.length; i++) {
if (options[i].text == optionText) {
Xrm.Page.getAttribute("new_status").setValue(options[i].value);
}
}
}
No comments:
Post a Comment