Case:
I think its a common scenario of wanting to have:
a to-one relation field to one of the child entities in another (collection) field of the same current entity.
- For example, you have a project with tasks and you have a to-one select field in the project to perform an automation on one of these tasks.
- Other example: You have a Page with child Versions, and the Page also has a to-one field to the ‘Current Version’ entity.
Issue:
The select dialog of the to-one relation to the single entity, cannot be filtered to only show child entities of the entity.
For example: the dialog cannot filter the selectable Tasks by the Tasks of the parent Project.
See below my attempts, which have failed:
Dynamic filter options are not helpful here:
Here I created a lookup to the parent Page its Blocks, to filter if the Current Block is part of it. that works, but only if the Current Block field already has a value.
Because if the Current Block field is empty, then it shows ‘There are not suggested Blocks’
WORKAROUND
So the more complex workaround is to create a third field as well as a lookup. So yet another to-one relation field in the parent Page to the Block db, which is always populated (automatically).
Are there other solutions that I did not see yet?