Hi all,
Is it possible to either disable an item in a Choice field so that it cannot be selected? Alternatively, (and perhaps even better) dynamically edit the choices by adding/removing items based on a condition? See my comment in the 'for loop' below.
Thanks for any and all suggestions.
function disablePTClassOfTravelChoice(executionContext) {
var formContext = executionContext.getFormContext();
var caseTypeText = formContext.getAttribute("kcw_casetype").getText();
var choiceField = formContext.getControl("kcw_scopeptclassoftravel");
var options = choiceField.getOptions();
for (var i = 0; i < options.length; i++) {
/*
Test the value(label?) of the option and if it is the one we are looking for
then either disable it as a valid option or better yet remove it from the
list of options.
*/
}
}