I’ve added a custom button on customer doctype to pre filter a linked doctype but seems it’s not working. Here is how I went about it:
frappe.route_options = {"customer": frm.doc.name}
frappe.set_route('List', 'FT Machine')
Is this the right way?
I’ve added a custom button on customer doctype to pre filter a linked doctype but seems it’s not working. Here is how I went about it:
frappe.route_options = {"customer": frm.doc.name}
frappe.set_route('List', 'FT Machine')
Is this the right way?
They look the same? But mine just isn’t working
Please share your code with the field name if possible.
Above examples stopped working for us with version 13. This worked:
frm.add_custom_button( ("Pay All Invoices"), function(){
var local_doc = frappe.model.get_new_doc('Payment Entry');
local_doc.posting_date = 'Today';
local_doc.naming_series = 'PE-';
local_doc.payment_type = 'Pay';
local_doc.party_type = 'Supplier';
local_doc.party_name = frm.doc.name;
frappe.set_route('Form',"Payment Entry",local_doc.name);
});
Routing to Form is working, I’m having challenges with routing to Lists, with filters
The code is just as similar to what I posted, it worked in v13
Did it work for you ?
I am facing same problem
Unfortunately no, it just works some times, and some times it doesn’t. Could be related to:
if the field you’re passing is available on the filters (main), yet to be certain of this but you can test it yourself.
Hi @NCP , How to apply route_options or filters in my case because only frappe.set_route(“Report”, “Uncleared Checks Report”) apply filter but in my route is different
frappe.route_options = {
"name": frm.doc.name
};
frappe.set_route("uncleared-checks-report", "view", "report", "Uncleared Checks Report", {"name": frm.doc.name});