Use Below method to check whether a picklist contains a value:
Parameters:
var options = Xrm.Page.getAttribute('statuscode').getOptions();
options: list of options
valueToCheck: Int
function StatusContainsValue(options, valueToCheck) {
var found = false;
for (var i = 0; i < options.length; i++) {
if (vendors[i].value == valueToCheck) {
found = true;
break;
}
}
}
No comments:
Post a Comment