Frappe.set_route() not applying route_options or filters

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?

Hi @redgren,

Please check it base example.

Hope it helps you.

Thank You!

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);
		});

1 Like

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

1 Like

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.