Hello guys
i’m trying to filters child table column based on the selected option in parent table.
my child table: “Warehouse Category Table” with following fields; equipment, location
my parent table: “Warehouse Category” with following fields; subcategory.
I want to select the subcategory and filters equipment and location belong to subcategory in the child table.
below is my code
//filter dropdown in Link Field type in a Child
frappe.ui.form.on(‘Equipment Category’, {
setup: function(frm){
frm.set_query(“equipment”, “equipment_movement”, function(doc, cdt, cdn){
let d = locals[cdt][cdn];
return {
filters: [
[‘Equipment’, ‘equipment’, ‘in’, 'Vehicles, Scaffold, Other tools, Power tools, Form work, Storage Facilities '],
[‘Equipment’, ‘location’, ‘=’, d.location]
]
}
});
}
});
my screenshot