Hi expert,
Have a requirement, that hide/display multiselect column - abc_multiselect_A based on another multiselect column - abc_multiselect_B item select, if select choice value, for example: 101010003, display abc_multiselect_A, otherwise hiden it. Script as below:
function toggleMultiSelectVisibility(executionContext) {
debugger;
var formContext = executionContext.getFormContext();
var selectedOptions = formContext.getAttribute('abc_multiselect_B').getSelectedOption();
if (selectedOptions.filter(i => i.value != 101010003).length > 0) {
formContext.getControl("abc_multiselect_A").setVisible(false);
} else {
formContext.getControl("abc_multiselect_A").setVisible(true);
}
}
The error: selectedOptions = null.
Could you please help to fix? Thanks.