Line total with a live formula
Show quantity × unit price instantly while the user fills a form. A form Live formula runs in the browser; use an auto field when the same total must stay correct after imports, API writes, or related-record changes.
When to use this
- Order / quote / invoice line forms
- Any create/update form where two number fields on the same form drive a third
Prefer an auto numeric expression instead when:
- lines are created outside that form (import, API, tasks);
- a parent order total must sum a stored field;
- you need server-side placeholder functions.
Data model
| Object | Key fields |
|---|---|
| OrderLine | quantity (Number), unit_price (Number), line_total (Number) |
unit_price can still be filled from a priced dropdown.
Steps
- Put
quantity,unit_price, andline_totalon the same Form. - Open settings for
line_total. - Set Live formula to:
{quantity}*{unit_price}
- Mark
line_totalread-only if users should not edit the result.
Read-only is display-only
Read-only form fields are not saved to the database. For a value other pages, grids, or a parent sum must read, either:
- leave the field editable (users can still overwrite; it recalculates when dependencies change), or
- use an auto field with Set to a numeric expression
{quantity} * {unit_price}so the value is stored and kept up to date.
Tips
- Only fields on this form can appear in the expression (not the target field itself).
- Syntax is JavaScript after placeholders are replaced — see Live formula.
- Combine with a parent sum of prices once
line_totalis stored (auto field or saved form value).