Related Items Block – each related record with a form¶
The related items block shows the records on the other side of a relationship, each one drawn with a form of the related entity. The forms become part of the surrounding layout – in a horizontal stack they stand side by side, in a vertical stack under each other.
This page is part of the form block reference.
1. At a glance¶
| Purpose | Draws every related record with a form, directly inside the surrounding container |
| Typical use | Order positions edited in place, contact persons as cards, the address of a customer |
| Related | Related Items Grid Block, Related Items List Block, Related Items Timeline Block |
The block is only offered in forms that belong to an entity.
2. Settings¶
| Setting | Meaning | Default / required |
|---|---|---|
| "Relationship" | The relationship whose records are shown – one of the entity of the form | Required. Without it the block shows nothing. |
| "Preview Form" | The form every related record is drawn with – a form of the related entity | Required. Without it the block shows nothing. |
| "Disabled" | Condition under which everything in the related forms is read-only | not disabled |
| "Filter" | Condition evaluated per related record; only the records for which it is true are shown | all related records |
| "Sort By" | Value the related records are ordered by, evaluated per related record | the order in which they were loaded |
| "Sort Descending" | Reverses the order | off |
The block has no element of its own, so it only has "Display Name" and "Visible" of the settings every block has – no styling. To frame or space the related forms, put the block into a stack and style the stack.
3. Behaviour¶
- Filter and Sort By are evaluated against the related record: a field reference reads the field of the related record, not of the record the form shows. The filter is always active and cannot be changed by the user, so one relationship can feed several blocks that each show a part of it ("open tasks", "done tasks"). A record whose filter cannot be evaluated is kept rather than hidden.
- Sort By with a plain field orders by the type of the field – numbers as numbers, dates as dates, text alphabetically. Any other expression orders as numbers when every result is a number, otherwise alphabetically.
- Disabled wins over the conditions of the blocks inside the related forms: inputs, buttons and toolbars there are all disabled. This also applies to related items blocks further down.
- The related forms edit the related records in place. A change there that changes the record of the surrounding form – a total calculated over the positions, for example – redraws the surrounding form as well. Everything is stored when the record is saved.
- Records that were created in the form and are not saved yet are shown as well.
4. Example¶
Order positions. The order form has a horizontal stack with "Columns" = 1; inside it a
related items block over the relationship "Order → Positions" with the form "Position Row" (article,
quantity, price in one row). "Sort By" = the field "Position Number". "Disabled" =
Status = "Invoiced": invoiced orders show their positions read-only.
5. Limitations¶
- Every related record is drawn with a complete form. For many related records, the Related Items Grid Block is much lighter.
- The block has no buttons to add or remove records; use a button or toolbar with an action, or the grid or list block with their built-in buttons.