Company Filter Java Script

Customer Filter By Company java script

@Roger,

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
when i put this script it gives me this error and dont have a true response

@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.

Thank for your help @magic-overflow
But how can i filter customer by company do you have a script?