Have you built any parent-child relationships yet in Onit? If so, great! This tutorial will expand your skill set in this area. If not, however, this tutorial might not make a lot of sense - in that case, check out Creating a Parent-Child Relationship before moving on. In addition, you’ll also need to understand what an App Panel is in Onit if you’re not familiar with this concept, see our Displaying Related Atoms Dashboards as Tabs tutorial.
Sibling App Panels allow you to display all siblings related to the current Record. You might be wondering, though: What’s a sibling Record?
Imagine that you have one Matter Record in Onit, and it acts as the parent Record of many child Records in an Invoices App. When viewing any of the child Invoice Records, you’d like end-users to see an App Panel that lists all of the other Invoice Records that share the same parent Matter Record. Below is an example screenshot.
The current Record from which you are viewing the Sibling App Panel will also appear in the list of sibling Records; this is expected behavior.
In the example above, the individual child Invoices Records are not directly related to one another. Instead, their relationship comes from sharing the same parent Record. Below is a diagram that shows the relationship between the various records at play.
You might have read our other tutorial on Related App Panels and wondered, “Well, what’s the difference between a Related App Panel and a Sibling App Panel?” That's a good question!
Related App Panels live on a Parent Record and display all related Child Records. On the other hand, Sibling App Panels live on a Child Record and display all siblings related to the same Parent Record.
Sibling App Panels will not work with ManytoMany relationships, only HasMany/BelongsTo relationships.
It is important to note the difference between Sibling Records and Sibling App Panels. In the Creating a Sibling Relationship tutorial we refer to Records joined by a ManyToMany relationship as siblings. This does not mean that Records aggregated by a Sibling App Panel are related by a ManyToMany relationship. Records in a Sibling App Panel are not related to one another. And yes, we are using the word sibling in two completely different ways.
Building a Sibling App Panel
- Navigate to the child App’s Advanced Designer page and choose the App Panels node. For example, sticking with the example used above, navigate to the Invoices App.
- Click Add and select Sibling Atoms Dashboard from the dropdown.
- Enter a Name for the panel, which will be used as the panel’s display name.
- Enter a Height for the panel in pixels. This will set the height of the panel when selected. A 500px height is recommended.
- In the Relation Field choose the BelongsTo Field that points to the appropriate parent App. This Field must already exist in your Child App.
See this tutorial for more information on optional configuration (e.g., Data View, a Hidden If condition).
- Click Ok to save your configuration.
You’re done! Check out your Sibling App Panel to ensure that it displays all siblings properly.