Presentation rules
Presentation rules compute the two text labels every record carries: the
primary display name and the secondary subtitle line. Each rule pairs
a text template (what to render) with an optional condition (when the
rule applies) and belongs to one target slot, DisplayName or Subtitle.
Rules are stored on the entity definition, so the same labels appear wherever
the record is shown or referenced.
Evaluation order
Section titled “Evaluation order”Rules are evaluated per target slot in ascending sort order. The first rule
whose condition evaluates to TRUE wins and its template is rendered; later
rules in the slot are not tried. An empty condition always matches, so a
condition-less rule at the end of the slot acts as the default.
If no rule matches, or the winning template renders only empty text, the
display name falls back to the record’s Number and the subtitle is simply
omitted.
Conditions
Section titled “Conditions”The condition uses the same profile as
field behavior conditions: fields of the record,
first-level reference paths (Customer.IsBlocked), and the shared operators —
comparisons, AND/OR/NOT, text operators, IN, NOT IN, null/empty
checks. Variables such as @today, function calls, and the BETWEEN range
operator are not available here; write a range as >= low AND <= high
(BETWEEN is available only in statements and validation rules — see
Availability by surface).
Nickname IS NOT EMPTYStatus = 'archived'Templates
Section titled “Templates”A template is plain text with { … } placeholders. Inside a placeholder you
can use:
- a field path:
{Name},{Customer.DisplayName}; - a literal:
{'fallback'},{42},{TRUE},{NULL}; - a text function call:
{upper(Code)},{lower(Email)},{trim(Code)},{coalesce(Nickname, Name)}; - a Select caption lookup:
{optionLabel(Category)}. The argument must be a direct path to aSelectfield.
Field paths can reach:
- scalar fields of the record’s primary table (
Tablefields are excluded); - the system value
{Number}; - first-level
Referencepaths — the referenced record’sId,Number,DisplayName,Subtitle, and its scalar fields; Moneysub-values through.Amountand.CurrencyCode.
Fields protected by field-level access rules cannot be used: presentation output is visible to everyone who can see the record, and a rule that references a restricted field is skipped at runtime.
Missing values render as empty text. The final result is
whitespace-normalized: consecutive whitespace collapses to single spaces and
the text is trimmed, so a template like {Code} — {Name} degrades cleanly
when one side is empty.
optionLabel(SelectPath) renders the configured option caption without
changing the stored value. For example, when Category stores logistics
and that option is configured as Логістика, {optionLabel(Category)} renders
Логістика, while {Category} still renders logistics. A null value renders
empty text. An unknown or removed option renders its raw stored key. A
multi-select preserves stored order and joins captions and fallback keys with
, . Resolution is culture-independent apart from the configured caption.
Changing a referenced field from Select to another type is rejected while
an active workspace presentation or display-field rule still calls
optionLabel for that path; update the dependent rule first.
Example
Section titled “Example”Two DisplayName rules — a specific rule first, a default last:
Condition: Nickname IS NOT EMPTYTemplate: {upper(Code)} — {Nickname}
Condition: (empty — always matches)Template: {upper(Code)} — {coalesce(Name, 'unnamed')}Configuration
Section titled “Configuration”Presentation rules are part of the record type’s display settings, edited
together with numbering in the Constructor. Through the
Configuration API the
update-display-settings operation
(PUT /api/workspace/admin/entity-definitions/{entityDefinitionId}/display-settings)
persists the complete rule list with sort orders and row versions.
Validate a condition or template before saving with the
validate-rule-expression operation
(POST /api/workspace/admin/entity-definitions/{entityDefinitionId}/rule-expressions/validate)
using ContextType Presentation and ExpressionType Condition or
Template. The shared validation contract is described on
Rule expressions.