Update Related Record – setting fields of one related record¶
The command "Update Related Record" sets fields of one record related to the current record, without making it the current record. This page is for administrators who build actions that change related records, for example the positions of an order.
1. At a glance¶
| Purpose | Change a related record while the action stays on the current record |
| Typical use | Mark the selected position as delivered, update the related record a variable points to |
| Where in the editor | Toolbar menu "Data" → "Update Related Record" |
| Needs a user interface | No |
| Needs a current record | Yes |
| Changes the current record | No |
| Related | Update Entity Record, For Each Related Record, Save |
2. Settings¶
The settings are on the tab "General", below "Display Name", "Description" and "Execution Condition" (see Actions), and on the tab "Set Fields".
| Setting | Meaning | Default / Required |
|---|---|---|
| "Relationship" | A relationship of the current record's entity. The record to update is on its child side. | Required |
| "RecId" | Expression for the record id of the related record, evaluated against the current record – for example a variable or a reference field | Required |
The tab "Set Fields" offers the fields of the relationship's child entity, with "Clear Value" / "Set Value", "Value" and "Append" as in Update Entity Record. The value expressions are evaluated against the current record, not against the related record.
3. Behaviour¶
- Without a current record, relationship or "RecId", the command is skipped.
- "RecId" is evaluated. If the result is not a record id, the command is skipped.
- The record must be among the records currently related through the relationship. If it is not, the command is skipped.
- The values are computed and set on the related record; business rules that react on changed fields run. With "Append", the value is added to the end of the existing text.
- Open forms are drawn again.
The change is kept with the current record and stored when the current record is saved – add Save after the command.
Skipped commands leave a warning in the log; the action continues.
4. Example¶
Mark the selected position as delivered. A button next to the positions grid of an order. The action first writes the id of the selected position into the variable "Position" (for example with Update Variable), then:
| Setting | Value |
|---|---|
| "Relationship" | Order → Positions |
| "RecId" | variable "Position" |
| "Set Fields" | "Delivered" = true, "Delivered on" = today |
followed by Save.
To change all related records, use For Each Related Record with Update Entity Record inside the loop.
5. Limitations¶
- The editor does not offer the option "Save" for this command. Save with a separate Save command.
- The editor offers no quick values for fields with a list of valid values here.
- A related record that cannot be found is not reported to the user.