Task list default filter

Hello,

When I open the task list view, only tasks assigned to me with “open” status are shown. How can I change these default filters? I can’t find where they are created in the code.

Yes, you can do this using a custom script. See the filters parameter here:

https://frappeframework.com/docs/v13/user/en/api/list#standard-list-js

Edit: When they’re coming pre-set in ERPNext, they’re defined in the DOCTYPE_list.js file that sits in the same folder as the rest of the doctype. For Tasks, for example, that’s here:

I had noticed this, but changing the line that starts with “filters:” in a client script, or removing it, seems to have no effect. I also don’t see in this code where the “assigned to me” filter is being created. That’s why I supposed that default filters can be defined in other parts of the code.

Anothe related question. Why some list views retain the last used filter and others not? Is it something customizable?

Hmm…I’m able to get the listview script to work on other doctypes, but it looks like the values are getting overwritten with the task_list.js file in erpnext. The loading sequence should be the opposite in my opinion. I’m not sure if there’s an easy way to fix this. Hopefully someone more knowledgable will chime in.

Hi,

Has there been any further update on this?

I also cannot get task_list.js default filter to modify. Would anyone know where this is getting getting overwritten?

Any help would be great.

Ta.