I’ve got 2 child tables on my customer form that I wish to control the linked query results using set_query.
The first child table in the code works fine, however the second one doesn’t work at all.
The odd thing is that when I use the code as a client script, it executes correctly. When I run the code from my custom app, linked with the hooks.py, only that first set_query is executed.
Any suggestions would be very appreciated.
frappe.ui.form.on("Customer", "refresh", function (frm) {
frm.set_query("lease", "lease_summary", function () {
for (let i in frm.doc.lease_summary) {
return {
"filters": {
"customer": cur_frm.doc.name
}
};
}
});
frm.set_query("customer_id", "responsible_persons_list", function () {
for (let i in frm.doc.responsible_persons_list) {
return {
filters: [
['Customer', 'customer_group', 'in', 'Individual, Sole Trader'],
]
};
}
});
});