New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add eval support for link field filters #25453
feat: add eval support for link field filters #25453
Conversation
Mark as ready when done |
…op-ritvik-filter-eval-support
If they are part of the doctype definition already, can we also validate these filters in the backend? A common cause of unexpected behavior is when filters are set but users can still circumvent them, for example by pasting a different value or using the browser console. |
@barredterra eval stuff will be JS so again it will hard to redo it in server side. Also, we are starting a client rewrite project soon-ish, we'll figure out a better way to represent some of these things so they can be validated on both client and server side. (Not just search field but other validations too) |
@GursheenK @ruchamahabal FYI ^ |
Users can add dynamic filters based on some value from the form.
Use:
eval: doc.fieldname
or
eval: doc.fieldname1 + doc.fieldname2
Screen.Recording.2024-03-14.at.11.16.54.PM.mov
For Child Tables
2 types of filters can be added.
From the Child Table Row: to add these filters use
doc.child_table_field_name
From Parent Document: to add these use
parent.parent_doc_fieldname
Screen.Recording.2024-03-19.at.12.21.08.PM.mov
the expression added after "eval:" is evaluated and its value is returned.
docs: https://docs.erpnext.com/docs/user/manual/en/creating-custom-link-field#adding-filters-to-link-field