Apply filters in link field globally

Hello Team,

I want to apply a filter to the Project link field globally across all relevant DocTypes. This means I need to set default filters for every DocType’s form where the Project is linked, ensuring it only shows the filtered data of projects as example I want to show only Active Projects. Please help me with how to implement this globally.

Thank you!

1 Like

Please check this
https://docs.erpnext.com/docs/user/manual/en/creating-custom-link-field#adding-filters-to-link-field

This solution works only on particular form. I need a global solution which works on each and every form.

As far as I know, there is no such feature in Frappe to set globally for all the fields.

If you want to do that, you will have to modify or override this function of Frappe, which is not recommended.

One approach you can apply is to use frappe set_query, but you will have to do this in all the doctype JS files where you are using the Project link field.

https://frappeframework.com/docs/user/en/api/form#frmset_query