Hello ERPNext Community,
I’m facing a challenge with frm.set_query
in ERPNext and need guidance. My goal is to send custom arguments to a server-side query without having these filters re-applied by the client-side framework.
The Issue: When I pass custom filters to a server-side method, the client-side seems to reapply these filters locally after the server query, altering the returned dataset.
Current Code:
frm.set_query("employee_field", function() {
return {
query: "my_app.my_module.my_custom_query",
filters: {
'employee': frm.doc.employee,
'department': frm.doc.department,
'branch': frm.doc.branch
}
};
});
I have implemented some custom logics on server side, The server-side processes these filters correctly, but I want to stop the client-side from applying them again and I don’t want to apply them.
Question: How can I ensure that custom arguments passed to a server-side method in frm.set_query
are not used for local filtering on the client side in ERPNext? Is there any other way to pass my values to server except filters
I have tried args
but didn’t work?
Any suggestions or best practices to resolve this would be greatly appreciated.
Thank you!