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
{{ message }}
Repository navigation
Commit 8445952
Browse filesBrowse the repository at this point in the historyBrowse files
docs(skills): the data skill teaches `transferBehavior`, the Change Owner cascade of a relationship
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
objectstack-data's `rules/relationships.md`, Delete Behaviors: one paragraph says what `transferBehavior: 'cascade'` on a child's `lookup` / `master_detail` does (the parent's Change Owner dialog offers to move the child rows its previous owner owns too), when to declare it, that the default is `'none'`, and where parse refuses it: the key on any other type, and `cascade` on a `sys_*` reference, on `multiple: true`, and on a child that does not offer Change Owner itself, such as a `controlled_by_parent` detail. `rules/field-types.md` lists the key on the `lookup` and `master_detail` rows. `evals/objects-fields-relationships.json` gains one case. The new text is paid for by removing restatement in the same files: in relationships.md the two "Incorrect" code blocks become one sentence each, and two `required: false` lines and five comment or prose repeats go; in field-types.md the autonumber example that the Autonumber section already gives and two "embedded" repeats go.
Copy file name to clipboardExpand all lines: skills/objectstack-data/evals/objects-fields-relationships.json
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -486,6 +486,21 @@
486
486
"overrides:"
487
487
]
488
488
}
489
+
},
490
+
{
491
+
"id": 28,
492
+
"prompt": "When a sales manager changes the owner of an `account`, the Change Owner dialog should offer to hand the account's `opportunity` records that the old owner owns to the new owner too. `opportunity.account` is a `lookup` to `account`. A colleague proposes a hook on `account` that rewrites `owner_id` on its opportunities. What do we declare instead, and where is that declaration refused?",
493
+
"expected_output": "No hook: declare the cascade on the child's reference field, beside `deleteBehavior`: on `opportunity`, `account: { type: 'lookup', reference: 'account', transferBehavior: 'cascade' }`. The account's Change Owner dialog then offers that relationship, and moves the opportunities the account's previous owner owns; the default `'none'` leaves them with their owner. The key is refused at parse on any type but `lookup` / `master_detail`; `cascade` is also refused on a reference to a `sys_*` object, on a `multiple: true` field, and on a child object that does not offer Change Owner itself, such as a `controlled_by_parent` detail.",
|`master_detail`| Parent–child with lifecycle control |`reference`, `deleteBehavior` (`cascade`/`restrict` — `set_null` is refused), `transferBehavior`, `lookupAutofill`|
94
94
|`tree`| Hierarchical self-reference |`reference` — optional; when written, this object's own name (any other object is refused at parse) |
95
95
|`user`| Person picker — a lookup specialized to `sys_user` (reviewer, watchers). Stored identically to `lookup`|`multiple` (collaborators), `defaultValue: 'current_user'`, `deleteBehavior` (no default; declared, as on `lookup`: relationships.md → Delete Behaviors) |
96
96
@@ -122,8 +122,8 @@ Stored as JSON on the parent row, no separate table/FK:
122
122
123
123
| Type | When to Use |
124
124
|:-----|:------------|
125
-
|`composite`| Single embedded JSON object, **untyped**: a field declares no sub-fields (`fields`/`subFields` are refused) |
126
-
|`repeater`|Embedded JSON **array**, **untyped**: no sub-fields or `columns`; a typed list is a `master_detail` child a parent `fieldGroups[].relatedList` names |
125
+
|`composite`| Single JSON object, **untyped**: a field declares no sub-fields (`fields`/`subFields` are refused) |
126
+
|`repeater`| JSON **array**, **untyped**: no sub-fields or `columns`; a typed list is a `master_detail` child a parent `fieldGroups[].relatedList` names |
127
127
|`record`| Name-keyed **map** of embedded sub-objects (insertion order = display order; ADR-0007) |
128
128
129
129
## Calculated
@@ -132,7 +132,7 @@ Stored as JSON on the parent row, no separate table/FK:
132
132
|:-----|:------------|:-------|
133
133
|`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`|
134
134
|`summary`| Roll-up aggregation from child records |`summaryOperations` ({ object, field? (omit for `count`), function, relationshipField?, filter? }) |
0 commit comments