Hello,
I am now in a child table, I want to make a filter depend on another field in the same child table so when I change Asset Class the Asset Major Class is changing according to its asset class parent.
this is my code, that filter Asset Class field
frappe.ui.form.on(“Material Request”, {
setup: function(frm) {
frm.set_query(“asset_class”, “items”, function() {
return {
filters: {
“category_type”: “Class Type”
}
}
})
}
});
This is my code that have trouble ,
frappe.ui.form.on(“Requested Item”, {
asset_class: function (frm) {
frm.set_query(“asset_major_class”, function () {
return {
filters: {
“class_type_name”: frm.doc.asset_class
}
};
});
}
});