1

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;
}
});

1 Answer 1

0

You can achieve that by customizing the form in infopath for add list item.

Hope this helps. Link: https://myspexp.wordpress.com/2011/05/09/cascading-drop-downs-in-sharepoint-lists/

1
  • 2
    You can add some brief details from the link. This will preserve content here on this site. Links may get broken.
    – Asad Refai
    Commented Jan 15, 2018 at 1:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.