You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**dependsOn**|`string`| optional | Parent field name for cascading |
162
-
|**visibleWhen**|`string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source?: string; ast?: any; meta?: object }`| optional | Visibility predicate (CEL) — field shown only when TRUE. Root: `record` (+ `previous`, `parent`) in runtime forms, or `data` in metadata forms. No `current_user` at field level — it is unbound here and the predicate would fault open (per-option `visibleWhen` is the surface that binds it). e.g. P`record.priority == 'urgent'`|
162
+
|**visibleWhen**|`string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source?: string; ast?: any; meta?: object }`| optional | Visibility predicate (CEL) — field shown only when TRUE. Root: `record` (+ `previous`, `parent`) in runtime forms, or `data` in metadata forms. No `current_user` at field level — it is unbound here and the predicate would fault open (per-option `visibleWhen` is the surface that binds it). Inside a repeater `data` is the ROW, but it is still spelled `data` — a bare identifier is unbound and faults open too. e.g. P`record.priority == 'urgent'`|
{field: 'reference',type: 'text',helpText: 'Target object name',visibleWhen: "type in ['lookup','master_detail','tree']"},
145
+
{field: 'reference',type: 'text',helpText: 'Target object name',visibleWhen: "data.type in ['lookup','master_detail','tree']"},
146
146
// `lookupFilters`, not `referenceFilter`: an array of
147
147
// {field, operator, value} rules, not a CEL string.
148
-
{field: 'lookupFilters',widget: 'json',helpText: 'Filter rules applied to the picker ({field, operator, value})',visibleWhen: "type in ['lookup','master_detail']"},
148
+
{field: 'lookupFilters',widget: 'json',helpText: 'Filter rules applied to the picker ({field, operator, value})',visibleWhen: "data.type in ['lookup','master_detail']"},
149
149
// `deleteBehavior`, not a `cascadeDelete` boolean: the schema models
150
150
// three outcomes, and only one of them is "cascade".
151
-
{field: 'deleteBehavior',type: 'select',helpText: 'What happens when the referenced record is deleted',visibleWhen: "type in ['lookup','master_detail']",options: [
151
+
{field: 'deleteBehavior',type: 'select',helpText: 'What happens when the referenced record is deleted',visibleWhen: "data.type in ['lookup','master_detail']",options: [
* bound for **per-option** `visibleWhen` (a different evaluator —
1425
1425
* `resolveCascadingOptions` against the host's predicate scope, ADR-0068 /
1426
1426
* objectui#2284); that is the only `*When` surface where it resolves.
1427
+
*
1428
+
* **Inside a repeater, `data` is the ROW, not the whole document** (#6254).
1429
+
* A sub-field of a `type: 'record'` / repeater field is rendered with its own
1430
+
* activation — the metadata form renderer evaluates each sub-field predicate
1431
+
* as `evaluatePredicate(spec.visibleOn, { data: row })` — so `data.type`
1432
+
* means *this row's* `type`, which is what a per-entry rule wants. The root
1433
+
* is still spelled `data` at every depth: there is no implicit row scope, so
1434
+
* a BARE identifier (`type == 'formula'`) is unbound and the predicate faults
1435
+
* open, showing the field for every row — the same fail-open direction the
1436
+
* `current_user` note above describes, arriving from the other end. Prefix
1437
+
* every reference with `data.` whether the field sits at the top level or
1438
+
* inside a repeater.
1427
1439
*/
1428
-
visibleWhen: ExpressionInputSchema.optional().describe("Visibility predicate (CEL) — field shown only when TRUE. Root: `record` (+ `previous`, `parent`) in runtime forms, or `data` in metadata forms. No `current_user` at field level — it is unbound here and the predicate would fault open (per-option `visibleWhen` is the surface that binds it). e.g. P`record.priority == 'urgent'`"),
1440
+
visibleWhen: ExpressionInputSchema.optional().describe("Visibility predicate (CEL) — field shown only when TRUE. Root: `record` (+ `previous`, `parent`) in runtime forms, or `data` in metadata forms. No `current_user` at field level — it is unbound here and the predicate would fault open (per-option `visibleWhen` is the surface that binds it). Inside a repeater `data` is the ROW, but it is still spelled `data` — a bare identifier is unbound and faults open too. e.g. P`record.priority == 'urgent'`"),
1429
1441
/** @deprecated ADR-0089 — use `visibleWhen`. Accepted and normalized to `visibleWhen` at parse. */
1430
1442
visibleOn: ExpressionInputSchema.optional().describe('[DEPRECATED → `visibleWhen`] Visibility predicate (CEL). Normalized to `visibleWhen` at parse.'),
1431
1443
disclosure: z.enum(['inline','popover']).optional().describe('Composite rendering: inline bordered box (default) or a summary line + gear popover (progressive disclosure).'),
0 commit comments