Listview Filter

I have a doctype Class Schedule

In class_schedule.js I have the following code

frappe.listview_settings['Class Schedule'] = {
	filters:[["session_type","=", "Individual"]]
};

Funnily I am not able to get the listview to load with the above filer. ie session_type=“Individual”
any idea?

2 Likes

try it in class_schedule_list.js

Funnily I get the same result. Any other reason for it to behave differently?

frappe.listview_settings['Class Schedule'] = {
	onload: function(listview) {
		if (!frappe.route_options){ //remove this condition if not required
			frappe.route_options = {
				"session_type": ["=", "Individual"]
			};
		}
	}
};

Check if this works?

7 Likes

That worked! ty

2 Likes