Filter Query not working for customer

frappe.ui.form.on("Sales Invoice", "refresh", function(frm, cdt, cdn) { 
frm.set_query("customer", function (doc) {
    			return {
    				   "filters": {
    				           "name": ["in", ["01", "02"]] 
           					}
        			};
    		});
});

I set it on refresh event…but still not working…tested other fields and working fine…What may cause this?

Try to make filters value as list like:

"filters": [
		 "name": ["in", ["01", "02"]] 
       					        ]

not working…syntax error. Any idea?

look at this
IDK, if you have to remove quotes from “filters”

frm.set_query("print_format_for_online", function() {
		return {
			filters: [
				['Print Format', 'doc_type', '=', 'Sales Invoice'],
				['Print Format', 'print_format_type', '=', 'Server'],
			]
		};

});

not working …just confused it’s working fine for other field

frappe.ui.form.on("Sales Invoice", "refresh", function(frm, cdt, cdn) {
	frm.set_query("customer", function() {
		return {
			filters: [
				['Customer', 'name', '=', '01']
			]
		};
	});
});

You can used below code:

cur_frm.set_query(“score”, function () {
return {
“filters”: {
“Customer”: “Ketan”
}
};
});

Thanks.

none is working…any idea?

I’m using that, but on a child table:

frappe.ui.form.on('Maintenance Visit', {

        local_manutencao: function (frm) {

                frm.fields_dict.purposes.grid.get_field('agendado_para2').get_query = function () {
        	        return {
        	                filters: {
                       			'department': ['in', ['Diretoria', 'Assistência Técnica']]
        	                }
        	        }
                }
         }
});