Customer Filter By Company java script
set_query method to set the filters to any fields.
frm.set_query("customer", function() { return { filters: { 'company': frm.doc.company } }; });
Thanks,
Makarand
@makarand_b
i put this script i dont have an error but it didnt work
frappe.ui.form.on(“Sales Invoice”, “refresh”, function(frm){
cur_frm.set_query(“customer”, function() {
return {
filters: {
‘company’: frm.doc.company
}
};
});
});
the script doesn’t has error as i tested. Make sure you have correct double quote and single quote once you copied and pasted.
But the script seem not filter customer by company.