I have two lookup fields that are cascaded with each other like: 1. Function and 2.category. First I select Function based on that Category field gets value.
But I have to set value in these two fields based on selection of other lookup ID field.
I am able to set value in Function field using below code. But is not getting set for category as I am not performing any action on Function field hence value is going to Category field. Can anyone help on this?
var checkfunction = ListItem.get_item("Functionn").get_lookupValue();
var allOptions = document.querySelectorAll("[title=Functionn] option");
[].some.call(allOptions, function(option) {
if (option.innerHTML == checkfunction ) {
option.selected = "selected";
return true;
}
});