11 Use Multiple Layouts for Multi-level Business Objects
When business objects in your REST service have a parent-child relationship of 3 or more levels, you can link layouts in a hierarchy of dependent layouts to perform coordinated download, upload, and clear operations. Many operations triggered in a layout that's part of a hierarchy of dependent layouts work on all layouts in the hierarchy.
In addition to coordinating operations such as download and upload across multiple layouts, there's another key distinction when using layouts in a dependent hierarchy: In the grandchild layout, the add-in will fetch all rows for each of the child rows and display them all together in the grandchild layout. This behavior applies to the grandchild and lower layouts in the hierarchy (basically, all Table layouts that follow the primary Form-over-Table layout.
Consider this example hierarchy of business objects, where purchaseOrders is the parent, lines is the child, schedules is the grandchild, and distributions is the great-grandchild.
In this hierarchy, purchaseOrders is a collection of top-level purchase orders, lines manages the details of each order (such as the item to purchase, quantity, unit of measure, and price), schedules is used for details such as ship-to location and delivery date, and distributions is used for details about accounting or the project. Each purchase order may contain multiple lines, each line may be broken down into multiple schedules, and each schedule may have multiple distributions.
Note:
Sibling relationships (two or more layouts with the same parent layout) are not supported.Let's use this example to create a hierarchy of dependent layouts that mirrors your business object hierarchy. Remember, the primary layout in the hierarchy must be a Form-over-Table; the dependent layouts must be Tables.
Before you publish and distribute your workbook to users, test the workbook to ensure that download, upload, or clear operations work on all layouts in the hierarchy (see Manage Data for Layouts in a Dependent Hierarchy).