Target Child Table for List View Filter

Hello,

I am using buttons to automatically set certain filters to make life easier for the user. It is working fine for parent doctype fields, but I cannot get it to work if I am trying to set a filter based on a child table/multiselect value. Here is a working snippet that shows how to set filter for parent doctype fields:

                // Clear existing filters and add new ones
                listview.filter_area.clear();
                listview.filter_area.add('Doctype A', 'date_of_birth', '>=', from_date);
                listview.filter_area.add('Doctype A', 'date_of_birth', '<=', to_date);

Any idea how I can use the filter_area.add functionality or something else to actually set the filter allowing the user to add even more filter manually? We can also use frappe.set_route but it isn’t allowing the user to add more.

Any idea?

Thanks in advance!

Found a solution but it isn’t as straightforward as it could be, I guess:

listview.page.add_inner_button(__(‘Click here’), function() {
// Construct the URL with the desired filters
const filtered_url = ‘/app/doctype-a/view/list?[Name of the parent doctype field]=[“is”,“not+set”]&[name of the field within the child table is supposed to be part of the filter]=[“is”,“not+set”]’;

        // Redirect the browser to the URL with the filters
        window.location.href = filtered_url;
    });
}

};