Hi all,
I’m trying to implement a dynamic filter for a Link field in a child table (grid) in Frappe/ERPNext, but I’m a bit stuck. I want the options in the Link field to change dynamically based on other fields or already selected values in the same table.
For example:
- I have a child table called
sprint_backlog_management. - Each row has a Link field
backlogpointing toBacklog Management. - I want the
backlogdropdown to exclude backlogs that have already been selected in other rows. - Ideally, if a row is removed or edited, the options in other rows should update automatically.
I know I need to use something like get_query on the field, but I’m not sure about the best way to implement it safely, especially for child table rows that may not exist yet when the form loads.
Could anyone guide me on the proper approach or provide an example of how to:
- Get all the currently selected values in the table.
- Apply a dynamic filter to a Link field in each row.
- Handle updates when rows are added, edited, or deleted.
Thanks in advance!