Set filter to child table

Hello ,
I want to navigate from one doctype to other with passing filter

value in the filter should be equal to name of child table
when I use filter every thing is ok

but when i set filter from code does not work , and that is ,my code

frappe.listview_settings['Categories'] = {
add_fields: ["image_attach", "parent_category"],
onload: function(me) {
	$('body').on('click','.cp-count',function(){
		
		frappe.route_options = {"Catagory.categories": "CAT00040"}
		frappe.set_route("List", "Products")
	
	})
}}

and result is :

so whats the right format to set filter to value exists in child table ?
thanks

Try

`tabCategories`.category

@rmehta this solution does not work

child table

and categoried_products doctype is

I stumbled on this link in search for an answer to the original poster’s question and was disappointed that there was not a satisfactory answer.

After hours of pouring over google to no avail, I finally turned to the code base and found the function that controls the filters getting set in route options.

The syntax for what we are trying to achieve is

frappe.route_options = { "DocType Name.field" : value }

So in the case of the original Poster… your code should look like this:

frappe.route_options = { "Categories Products.categories" : "CAT00040"}

Hope this helps others as well!

4 Likes