Skip to content

Commit 144cdc2

Browse files
docs(skills): teach the lookupFilters { $record } reference and orEmpty (#34528)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwB5crsrYoZ5Eg3aoQQucQsHv)_ Fixes #34201 Clause-②: no Metadata-protocol: none Skills-docs: updated here ## 维护者速读 - 改了什么:`objectstack-data` 技能的 `rules/field-types.md` 和两页数据建模文档(`relationships.mdx`、`fields.mdx`)开始教 lookup 筛选里的 `{ $record }` 引用和 `orEmpty`:引用怎么写、引用值为空时这条筛选被略过、`orEmpty` 及它能搭配的六个运算符、它和 `dependsOn` 的区别。 - 为什么改:这两个写法的读取方(表单里的记录选择器)已随 PR #34253 落地,规范里的「PLANNED」标记已摘掉,但技能和文档一个字都没提,AI 和作者不知道可以这样按当前记录筛选候选项。 - 风险与回滚:只改文档和技能文字,不动产品代码;技能文件原本零余量,先删了同文件 5 处重复(179 字节),再把该文件的 token 上限按实测从 3349 提到 3553(+204)。回滚即 revert 本 PR。 - 先看:`skills/objectstack-data/rules/field-types.md` 第 210–234 行(新教学)和第 42、132、254、264 行(删掉的重复);`scripts/check-skills-token-ratchet.mjs` 里 `field-types.md` 那一行上限及其注释;`content/docs/data-modeling/relationships.mdx` 第 44–83 行。 - 两分钟验证:`node scripts/check-skills-token-ratchet.mjs | grep field-types`,预期看到 `3553 / 3553 (+0)`,末行 ✓。 - 需要你做的:审阅并合并(改了 `skills/**`,属于需要你亲手合并的受管面)。 ## Liveness readings (the premise, measured at `9e6fee19`) The card says to teach only once the reader lands. Both shapes are read today, so both are taught: - `packages/spec/liveness/field.json`, row `lookupFilters`: `status: live`, `verifiedAt: 2026-11-16`. Its note names the readers: `ui/packages/fields/src/widgets/lookupRecordReference.ts#resolveLookupFilters` puts the value of the record being edited in place of each `{ $record }` reference, only on a field a record form stamped through `withRecordBeingEdited`, and leaves out an entry whose value is empty or cannot be read; `ui/packages/fields/src/widgets/RecordPickerDialog.tsx#lookupFiltersToRecord` sends `orEmpty: true` as an `$or` with a `$null` match on the same column. - Both files exist at `9e6fee19` and carry those functions (`git log` names the landing commit `2c296cf2`, PR #34253). `RecordPickerDialog.tsx` line 267 builds `{ $or: [{ [f.field]: condition }, { [f.field]: { $null: true } }] }`. - `[PLANNED — not enforced]` markers: `grep -c PLANNED packages/spec/src/data/field.zod.ts` answers 0; the `value`, `orEmpty` and `lookupFilters` describes say what the picker does. No spec marker is left to flip. - Before this PR: `grep -c -E '\$record|orEmpty'` answers 0 in each of the three target files (control: 36 hits in `packages/spec/src/data/field.zod.ts`). - The six operators are copied from `LOOKUP_FILTER_SCALAR_COMPARISONS` in `field.zod.ts`: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`. - The path check the docs page mentions (`os validate` refuses a path that names no field) is `object-field-ref-unknown` in `packages/lint/src/validate-object-field-refs.ts`, severity `error`. ## What changes **`skills/objectstack-data/rules/field-types.md`** (§ Lookup). The section's one example becomes a quote's `price_book` lookup with a literal entry, a `{ $record: 'quote_date' }` entry and a one-hop `{ $record: 'account.market' }` entry, both with `orEmpty: true`. One paragraph under it carries the four points: the reference is the whole `value` and pairs, like `orEmpty`, only with the six operators; only a record form resolves it and every other picker host leaves the entry out; an empty or unreadable value drops the entry; `orEmpty: true` also matches a null column; a `$record` field is not also listed in `dependsOn`, which would add an equality filter. It ends with the limit the spec states: the picker only narrows the choice. **`content/docs/data-modeling/relationships.mdx`** gains `#### Filter by the record being edited` under Filtered Lookups: the shape, one example (the same price-book case, with both date bounds), and five short bullets (the reference, where it resolves, an empty value, `orEmpty`, `dependsOn` or `$record`). **`content/docs/data-modeling/fields.mdx`**: one more lookup in the relationship example, the `lookupFilters` row of the property table names `orEmpty` and the reference, a `dependsOn` row is added, and a short `#### Lookup filters that read the record being edited` section states the four points and links to the relationships page. **`scripts/check-skills-token-ratchet.mjs`**: the `field-types.md` row moves 3349 → 3553, with its row comment (next section). ### The ceiling raise: cuts first, then the measured remainder `field-types.md` sat at zero headroom (3349 / 3349), so any teaching reds the ratchet. The standing ruling, verbatim and untranslated: 「A:先削重复,余额按实测提高」 (maintainer, 2026-10-27), the gate-recognised path per ruling record 6513306068 (letter B). The skills seat accepted the row edit as an in-scope widening for this card. Five same-file restatements are cut, 179 bytes. Each fact is still carried by the sentence named: | Cut | Bytes | Still carried by | |:---|---:|:---| | `secret` row: "**The recommended type for credentials**" | 41 | the `password` row, line 41: "Prefer `secret` for credentials" | | `autonumber` row: "({0000} counter + optional date / {field} tokens, resets per scope)", now "(→ Autonumber)" | 51 | § Autonumber: the token table (lines 254–256) and line 258, the paragraph that opens "The counter resets per" | | `autonumber` row: the second `format` example, `"AD{YYYYMMDD}{0000}"` | 24 | the token table, line 255: `AD{YYYYMMDD}{0000}` → `AD202606170001` | | Autonumber rule 3: "Size it for readability, not as a ceiling." | 43 | the same rule's heading, line 264: "Pad width is a MINIMUM, not a cap" | | token table, `{0000}` row: "(**minimum** width)" | 20 | rule 3, line 264 | The teaching adds 994 bytes; net +815 bytes. `wc -c` = 14210 → `ceil(14210 / 4)` = 3553 tokens. The row is pinned at the measurement, zero headroom, +204, and no other row moves. ### Published-skill size readings | | Before | After | |:---|---:|---:| | `rules/field-types.md`, lines | 252 | 265 (+13; the order's budget is +20) | | `rules/field-types.md`, bytes | 13395 | 14210 | | `rules/field-types.md`, tokens (the ratchet's count) | 3349 | 3553 | | all `skills/*/SKILL.md`, lines | 4594 | 4594 | | ratcheted authored files, tokens | 188607 | 188811 | | whole shipped bundle, tokens | 249100 | 249304 | ## Why The `{ $record }` reference and `orEmpty` were declared ahead of their reader and marked PLANNED; the docs half waited on the picker. The picker landed in PR #34253, so an author can now filter a lookup's candidates by the record being edited, and nothing an AI builder reads said so. ## Tests None owed: prose in two docs pages and one published skill file, and one data row in a gate script's map. No tested behaviour changes, so no ablation. The gate script's own suite is its `--self-test` (104 cases pass); no `*.test.*` file names it (`git grep -l check-skills-token-ratchet -- '*.test.ts' '*.test.mjs'` is empty). ## Acceptance notes - **No eval case.** `skills/objectstack-data/evals/objects-fields-relationships.json` has 20 cases and none covers lookup filters (`grep -c lookupFilters` answers 0), so by the order none is added here. - **File surface.** The claim lists the two docs pages, the skill file and the optional eval file. `scripts/check-skills-token-ratchet.mjs` is one more file, accepted by the seat before the push; the changeset is the fifth path. - **Attribution thread link.** The order prints the seat thread's link; this body carries this card thread's link, the one the session's attribution rule names. Same project, same requester. - **Not touched, noted only.** `content/docs/data-modeling/field-types.mdx` also describes `lookupFilters` and dependent lookups and does not mention `{ $record }`. It is outside the card's three files. carrier: none. - **Changeset:** `@objectstack/skills` patch (`.changeset/34201-skills-lookup-filter-record-reference.md`), both declaration lines in it. - Out-of-scope findings: none. Security findings: none. ## Verification Head `09f66fe6` on `origin/main` `9e6fee19`. Main has since moved to `ec6b5fd3`; none of the four edited files changed there (`git diff --stat 9e6fee1 ec6b5fd` over them is empty), so the branch was not re-merged. **Derived set:** `node scripts/pm/dispatch-gates.mjs --commands` on the committed change set → 88 commands. Each ran in this worktree at `09f66fe6`, exit codes captured before any pipe; `--ran`: "88 derived famil(ies) accounted for — 87 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)". - `node scripts/check-skills-token-ratchet.mjs` → exit 0: "57 authored bundle file(s) within their ceilings"; `field-types.md` 3553 / 3553. - `node scripts/check-skills-token-ratchet.mjs --self-test` → exit 0, 104 cases pass. - `pnpm --filter @objectstack/spec run check:skill-examples` → exit 0, 347 prose examples type-check (after the `@objectstack/client-react...` and `@objectstack/lint...` closure build under the verify lock, VERDICT command-exit 0, 310 s). - `pnpm check:doc-anchors` → exit 0, 1042 internal fragment links resolve (the new `relationships#filter-by-the-record-being-edited` link among them). - `pnpm check:doc-authoring`, `pnpm check:skill-links`, `pnpm check:skill-identifier-liveness`, `pnpm check:ratchet-remedy-authority`, `pnpm check:pm-governed-merges`, `node scripts/check-empty-changeset.mjs --base origin/main`, `node scripts/check-changeset-no-major.mjs --base origin/main` → exit 0 each. - NOT MEASURED: `pnpm check:dual-build-cjs-loads`, exit 3, "PREREQUISITE NOT MET — this gate reads built output, and some package has no dist/". It needs a full `pnpm build`, which this diff does not otherwise owe (no package source moved); CI's build lanes carry it. Not run locally, CI's own: `pnpm lint` (repo-wide), the type-check lanes, `Test Core`, `Build Core`. No package test is owed: no package source moved. `node scripts/pm/check-governed-merges.mjs --branch HEAD`: governed, 1 of 5 paths (`skills/**`), landing tier H; 127 changed lines. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. (no names added) - [ ] 3. No formatter ran; `pnpm lint` passes. (no formatter ran; the repo-wide `pnpm lint` scan is CI's own run, so it is not claimed here: read the `Lint & Repo Gates` check-run) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English (the maintainer's ruling is quoted verbatim, untranslated). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufzhek783Lg4DsyfFDxo)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8d827da commit 144cdc2

5 files changed

Lines changed: 118 additions & 9 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): `objectstack-data` teaches the `lookupFilters` `{ $record }` reference and `orEmpty`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
objectstack-data's `rules/field-types.md` now teaches a lookup filter that reads the record being edited. A `lookupFilters` value may be `{ $record: 'field' }`, or one lookup hop away, `{ $record: 'lookup_field.field' }` (at most one dot). It is the whole `value`, never a member of an `in` / `notIn` list, and pairs only with `eq`, `ne`, `gt`, `lt`, `gte`, `lte`. Only a record form resolves it; every other picker host leaves the entry out, and while the referenced value is empty the entry is dropped. `orEmpty: true` also matches a candidate whose column is null, with the same six operators. The picker re-queries when a referenced field changes, so that field is not also listed in `dependsOn`, which would add an equality filter on it. The section's example is now a quote's price-book lookup.
11+
12+
Five restatements in the same file are cut to pay for part of it (the `secret` row's recommendation, which the `password` row states; the `autonumber` row's token summary and second format example, which the Autonumber section carries; and two repeats of "pad width is a minimum"). The data-modeling docs pages `relationships.mdx` and `fields.mdx` teach the same four points.

‎content/docs/data-modeling/fields.mdx‎

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@ primary_contact: Field.lookup('contact', {
212212
],
213213
}),
214214

215+
// Filtered by the record being edited: books valid on the quote's date, or with no start date
216+
price_book: Field.lookup('price_book', {
217+
label: 'Price Book',
218+
lookupFilters: [
219+
{ field: 'valid_from', operator: 'lte', value: { $record: 'quote_date' }, orEmpty: true },
220+
],
221+
}),
222+
215223
// A pick fills sibling fields: the picked product's list_price lands in unit_price
216224
product: Field.lookup('product', {
217225
label: 'Product',
@@ -238,13 +246,33 @@ order: Field.masterDetail('order', {
238246
| Property | Type | Description |
239247
| :--- | :--- | :--- |
240248
| `reference` (1st arg) | `string` | Target object name |
241-
| `lookupFilters` | `{ field, operator, value }[]` | Base filters restricting which records are selectable (structured, picker-honored) |
249+
| `lookupFilters` | `{ field, operator, value, orEmpty? }[]` | Base filters restricting which records are selectable (structured, picker-honored). `value` is a literal or a `{ $record }` reference — see below |
250+
| `dependsOn` | `(string \| { field, param? })[]` | Sibling fields that scope the candidates by equality; the picker is gated until they are set |
242251
| `deleteBehavior` | `enum` | `'set_null'`, `'cascade'`, `'restrict'` |
243252
| `inlineEdit` | `boolean \| 'grid' \| 'form'` | Render child records inline on the parent create/edit form (`true` = auto-pick, `'grid'`, or `'form'`) |
244253
| `inlineColumns` | `array` | Optional explicit columns for the inline grid |
245254
| `inlineAmountField` | `string` | Optional numeric child field for the inline running total |
246255
| `lookupAutofill` | `{ target, source, overwrite? }[]` | Fields of this object a pick fills from the picked record (single-value `lookup` / `master_detail` only) — see below |
247256

257+
#### Lookup filters that read the record being edited
258+
259+
A `lookupFilters` `value` can be `{ $record: 'field' }`, or one lookup hop away,
260+
`{ $record: 'lookup_field.field' }`: a value of the record being edited, which the picker
261+
of a record form sends in place of the reference.
262+
263+
- **The reference** is the whole `value` and pairs only with `eq`, `ne`, `gt`, `lt`, `gte`
264+
or `lte`. Outside a record form (inline edit, an action's parameter dialog, a bulk action)
265+
the entry is left out.
266+
- **An empty value** drops the entry: while the referenced value is empty or cannot be read,
267+
the other entries alone filter.
268+
- **`orEmpty: true`** also matches a candidate whose column is null; it pairs with the same
269+
six operators.
270+
- **Not `dependsOn`.** The picker re-queries when a referenced field changes. Listing that
271+
field in `dependsOn` as well would add an equality filter on it to the candidate query.
272+
273+
Details and a fuller example:
274+
[Filtered Lookups](/docs/data-modeling/relationships#filter-by-the-record-being-edited).
275+
248276
#### Lookup-pick autofill: `lookupAutofill`
249277

250278
A single-value `lookup` / `master_detail` can declare `lookupAutofill: [{ target,

‎content/docs/data-modeling/relationships.mdx‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,47 @@ contact: Field.lookup('contact', {
4141
structured `lookupFilters` (`{ field, operator, value }`) and `dependsOn` shown above instead.
4242
</Callout>
4343

44+
#### Filter by the record being edited
45+
46+
A `lookupFilters` value can read the record the form is editing instead of a literal:
47+
`{ $record: 'field' }`, or one lookup hop away, `{ $record: 'lookup_field.field' }` (at most
48+
one dot). The picker puts that value in its place before it queries the candidates.
49+
50+
```typescript
51+
// On quote: only price books valid on the quote's date,
52+
// in the customer's market or in none (a generic book)
53+
price_book: Field.lookup('price_book', {
54+
label: 'Price Book',
55+
lookupFilters: [
56+
{ field: 'is_active', operator: 'eq', value: true },
57+
{ field: 'valid_from', operator: 'lte', value: { $record: 'quote_date' }, orEmpty: true },
58+
{ field: 'valid_to', operator: 'gte', value: { $record: 'quote_date' }, orEmpty: true },
59+
{ field: 'market', operator: 'eq', value: { $record: 'account.market' }, orEmpty: true },
60+
],
61+
})
62+
```
63+
64+
- **The reference.** `{ $record }` is the whole `value`, never a member of an `in` / `notIn`
65+
list, and pairs only with `eq`, `ne`, `gt`, `lt`, `gte` or `lte`. `os validate` refuses a
66+
path that names no field of the object the lookup is on, or of the object its hop points at.
67+
- **Where it resolves.** In a record form, whatever its layout. Every other picker host leaves
68+
every `{ $record }` entry out: inline edit on a record page, a record page's header or
69+
related list, an action's parameter dialog, and a bulk action over selected rows.
70+
- **An empty value.** While the referenced value is empty (null, unset, an empty string, or a
71+
hop whose lookup is unset) or cannot be read, the entry is left out of the candidate query:
72+
a quote whose account has no market is offered every book the other entries admit.
73+
- **`orEmpty: true`** makes the entry also match a candidate whose column is null ("valid from
74+
the quote date, or with no start date"). Like `{ $record }`, it pairs only with `eq`, `ne`,
75+
`gt`, `lt`, `gte` or `lte`.
76+
- **`dependsOn` or `$record`?** `dependsOn: ['account']` scopes the candidates by equality on
77+
the parent field and gates the picker until that field is set. A `$record` entry compares
78+
any candidate column, with any of the six operators, and is left out while its value is
79+
empty. The picker re-queries whenever a referenced field changes, so do not also list that
80+
field in `dependsOn`: `dependsOn: ['quote_date']` would add `quote_date = …` to the query
81+
over the referenced object.
82+
83+
The picker narrows the choice only: a rule the save must enforce belongs on the server too.
84+
4485
### Self-Referencing Lookups
4586

4687
Create hierarchies:

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,22 @@ export const CEILINGS = new Map([
909909
// zero headroom, ceiling +141, pinned AT the measurement. Standing ruling (2026-10-27,
910910
// tap A, verbatim and untranslated): 「A:先削重复,余额按实测提高」; recognised path per
911911
// ruling record 6513306068; seat widening record 6784270263.
912-
['skills/objectstack-data/rules/field-types.md', 3349],
912+
// 3349 -> 3553 (#34201, 2026-11-16): § Lookup teaches the `lookupFilters`
913+
// `{ $record: 'path' }` reference (a field of the record being edited, or one lookup
914+
// hop), its six operators, the record-form-only resolution, the dropped entry on an
915+
// empty value, `orEmpty: true`, and why a `$record` field is not also listed in
916+
// `dependsOn`; the section's one example becomes a `price_book` lookup. +994 bytes.
917+
// PAID DOWN FIRST by five same-file restatement cuts, 179 bytes (41 + 51 + 24 + 43 +
918+
// 20): the `secret` row's "recommended type for credentials" (home: the `password`
919+
// row, "Prefer `secret` for credentials"); the `autonumber` row's token-and-scope
920+
// parenthetical, cut to a pointer, and its second `format` example (home: § Autonumber,
921+
// the token table and the scope paragraph); rule 3's "Size it for readability, not as
922+
// a ceiling" (home: the same rule's heading); the token table's "(minimum width)"
923+
// (home: rule 3). `wc -c` = 14210 bytes -> ceil(14210 / 4) = 3553 tokens, zero
924+
// headroom, ceiling +204, pinned AT the measurement. Standing ruling (2026-10-27,
925+
// tap A, verbatim and untranslated): 「A:先削重复,余额按实测提高」; recognised path per
926+
// ruling record 6513306068.
927+
['skills/objectstack-data/rules/field-types.md', 3553],
913928
['skills/objectstack-data/rules/indexing.md', 3241],
914929
// 1590 -> 1909 (#32364, 2026-11-11): § Sealing (`seal`) teaches `lifecycle.seal`
915930
// (+1574 B). PAID DOWN FIRST by three same-file restatements (-296 B): the ❌

‎skills/objectstack-data/rules/field-types.md‎

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const fields = {
3939
| `url` | Web URLs — built-in format validation | `required` |
4040
| `phone` | Phone numbers | `format` |
4141
| `password` | ⚠️ Masked-on-read input. On a generic object the value is stored **PLAINTEXT at rest** (never hashed — one-way hashing applies only inside the auth subsystem's own identity tables). Prefer `secret` for credentials; a generic `password` field triggers a build warning | `minLength`, `maxLength` |
42-
| `secret` | Reversible **encrypted-at-rest** credential (DB password, API key, token) — encrypted on write via `ICryptoProvider`, masked on read, fail-closed (ADR-0100). **The recommended type for credentials** | — |
42+
| `secret` | Reversible **encrypted-at-rest** credential (DB password, API key, token) — encrypted on write via `ICryptoProvider`, masked on read, fail-closed (ADR-0100) | — |
4343
| `markdown` | Markdown-formatted content | `maxLength` |
4444
| `html` | Raw HTML content | `maxLength` |
4545
| `richtext` | WYSIWYG rich text editor | `maxLength` |
@@ -129,7 +129,7 @@ Stored as JSON on the parent row — no separate table / FK:
129129
|:-----|:------------|:-------|
130130
| `formula` | Computed on read: neither aggregatable nor a dataset or cube dimension (group key); both need a stored field of its return type with the same `expression` (objectstack-ui → Dashboards → Dataset-Bound Widgets) that reads only its own row (relationships.md → Computed column) | `expression` (CEL, `record.` prefixes), `returnType` (`'number' \| 'text' \| 'boolean' \| 'date' \| 'currency'`); `'currency'` carries its own `currencyConfig` |
131131
| `summary` | Roll-up aggregation from child records | `summaryOperations` ({ object, field? (omit for `count`), function, relationshipField?, filter? }) |
132-
| `autonumber` | Auto-incrementing display format ({0000} counter + optional date / {field} tokens, resets per scope) | `format` (shorthand) / `autonumberFormat` (canonical) — e.g., `"CASE-{0000}"`, `"AD{YYYYMMDD}{0000}"` |
132+
| `autonumber` | Auto-incrementing display format (→ Autonumber) | `format` (shorthand) / `autonumberFormat` (canonical) — e.g., `"CASE-{0000}"` |
133133

134134
## Enhanced Types
135135

@@ -211,15 +211,28 @@ delete the lines and purge the recycle bin, or move them to another invoice.
211211

212212
```typescript
213213
{
214-
type: 'lookup',
215-
reference: 'account',
214+
type: 'lookup', // price_book, on quote
215+
reference: 'price_book',
216216
required: true,
217217
lookupFilters: [
218-
{ field: 'status', operator: 'eq', value: 'active' },
218+
{ field: 'is_active', operator: 'eq', value: true },
219+
// the record being edited: a field, or one lookup hop (at most one dot)
220+
{ field: 'valid_from', operator: 'lte', value: { $record: 'quote_date' }, orEmpty: true },
221+
{ field: 'market', operator: 'eq', value: { $record: 'account.market' }, orEmpty: true },
219222
],
220223
}
221224
```
222225

226+
**`{ $record: 'path' }`** is the whole `value` (never an `in` / `notIn` member) and,
227+
like `orEmpty`, pairs only with `eq`, `ne`, `gt`, `lt`, `gte`, `lte`. Only a record
228+
form resolves it; every other picker host (inline edit, an action dialog, a bulk
229+
action) leaves the entry out. **Empty value:** while the referenced value is empty
230+
or unreadable, the entry is dropped. **`orEmpty: true`** also matches a candidate
231+
whose column is null. **Not `dependsOn`:** the picker re-queries when a `$record`
232+
field changes; listing it in `dependsOn` adds an equality filter (`quote_date = …`)
233+
on the referenced object. The picker only narrows the choice: a rule the save must
234+
enforce belongs on the server too.
235+
223236
### Formula
224237

225238
```typescript
@@ -238,7 +251,7 @@ The `format` is literal text interleaved with `{...}` tokens:
238251

239252
| Token | Renders | Example |
240253
|:------|:--------|:--------|
241-
| `{0000}` | The counter, zero-padded to that many digits (**minimum** width). At most ONE slot. | `CASE-{0000}` → `CASE-0042` |
254+
| `{0000}` | The counter, zero-padded to that many digits. At most ONE slot. | `CASE-{0000}` → `CASE-0042` |
242255
| `{YYYY}` `{YY}` `{MM}` `{DD}` `{YYYYMMDD}` | Generation date in the request's business timezone | `AD{YYYYMMDD}{0000}` → `AD202606170001` |
243256
| `{field_name}` | The value of another field **on the same record** | `{plan_no}{000}` → `PLAN-001001` |
244257

@@ -248,5 +261,5 @@ The `format` is literal text interleaved with `{...}` tokens:
248261

249262
1. **Every `{field}` you interpolate must be `required: true`** and set before the record is created. An empty interpolated field makes the record number generation *throw* (the compile lint flags a non-existent field as an error, an optional one as a warning).
250263
2. **Put a delimiter between adjacent variable tokens** — `{section}-{zone}{000}`, not `{section}{zone}{000}`. Without one, `('AB','C')` and `('A','BC')` both render prefix `ABC` and share a counter (to keep numbers unique).
251-
3. **Pad width is a MINIMUM, not a cap.** `{000}` → `001`…`999`, then `1000` (it grows, never wraps). Size it for readability, not as a ceiling.
264+
3. **Pad width is a MINIMUM, not a cap.** `{000}` → `001`…`999`, then `1000` (it grows, never wraps).
252265
4. **Only known tokens are interpolated.** Date tokens are **case-sensitive** — `{yyyy}` parses as a `{field}` reference and renders **empty** (rule 1 applies). Only a spelling no field could have — `{ YYYY }`, `{YYYY-MM}` — is emitted **literally**.

0 commit comments

Comments
 (0)