Working with parents parents attributes

I'm looking for the proper way to work with associated objects more than one level deep/high. For instance, I have a Policy -> Open Invoice -> Reminder model. One Policy can have many Open Invoices and one Open Invoice can have many Reminders. From Reminder, working with parent's attributes (Open Invoice) is fine. These attributes are available to you. From Reminder, working with parent's parent's attributes (Policy), I don't know how to do that properly. I made a virtual attribute on parent level, but that's not the same thing. For instance, you can't use the attributes as search fields. Thanks for the help. Toon Verschoor
2 answers

Good question!

Working with virtual attributes is definitely not the same thing. Virtual attributes are not saved in the database, which makes it impossible to search or sort on virtual attributes.

Currently, it's no problem to work with associations one level deep. Unfortunately, showing associated objects more than one level deep in a form is not possible yet... (but, work in progress, we have to wait until the 2.5 version is released).

For now, I have a solution which isn't smooth and proper at all: just add an extra association and make it one level deep. Policy - Reminder, set this association based on the associations Policy - Open Invoice and Open Invoice - Reminder by using microflow.


In our upcoming 2.5 release you can use attributes from objects associated to the current object via multiple steps. This holds for input fields in dataviews, columns in datagrids, and searchfields in datagrids.