Discard – throwing away unsaved changes¶
The command "Discard" throws away the changes of the current record that are not saved yet. This page is for administrators who build actions that change a record and may have to abandon the change.
1. At a glance¶
| Purpose | Undo unsaved changes of the current record |
| Typical use | Abandon an edit after a check failed or the user declined in a popup |
| Where in the editor | Toolbar menu "Data" → "Discard" |
| Needs a user interface | No |
| Needs a current record | Yes |
| Related | Save, Refresh, quick action "Discard" |
2. Settings¶
The command has no settings of its own – only "Display Name", "Description" and "Execution Condition" on the tab "General" (see Actions).
3. Behaviour¶
- Without a current record, the command is skipped.
- All changes of the current record that are not saved are thrown away – also those of its related records that are loaded, for example positions changed in a related items grid.
- Related records that only exist because the relationship always creates one, and were not saved, are removed.
- The database is not read again. Changes saved before – by the user or by an earlier command of the action – are not undone.
4. Example¶
Confirm or abandon. An action sets the status of an order to "Cancelled" and the cancellation date
(Update Entity Record without "Save"), then shows a popup "Cancel this order?" with the buttons
"Yes" (result yes) and "No" (result no). A Switch saves on yes and runs Discard on
no – the order is unchanged.
5. Limitations¶
- What was already saved stays saved. There is no rollback across commands.
- To also read changes that others saved in the meantime, use Refresh after Discard.