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 2b566c7
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: content/docs/data-modeling/object-extensions.mdx
+49-3Lines changed: 49 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Object extensions — extend without forking
3
3
navTitle: Object Extensions
4
-
description: Add fields, validations and indexes to an object another package owns, without forking it — declaration, merge order, and what an extension may not contribute.
4
+
description: Add fields, validations and indexes to an object another package owns, or relabel its fields, without forking it — declaration, merge order, and what an extension may not contribute.
5
5
---
6
6
7
7
Every object has exactly **one owning package**. That package defines the table, the
@@ -63,6 +63,7 @@ check that spelling first.
63
63
| Key | Merge behaviour |
64
64
|:---|:---|
65
65
|`fields`|**Additive.** Merged into the target's field map. A name the target already has is **replaced**, not merged. |
66
+
|`fieldPatches`|**Applied, field by field.** Changes the *display* of one of the target's own fields without replacing it — [below](#relabelling-a-vendor-field). |
66
67
|`validations`|**Concatenated.** Your rules run alongside the owner's; neither replaces the other. |
67
68
|`indexes`|**Concatenated**, same as validations. |
68
69
|`label`| Replaces the target's label — with one exception, [below](#extensions-and-tenant-customization). |
@@ -76,7 +77,7 @@ Added fields are ordinary fields, so everything on the
76
77
77
78
### What an extension may **not** contribute
78
79
79
-
The merge carries the seven keys above and nothing else. These four are not
80
+
The merge carries the eight keys above and nothing else. These four are not
80
81
"unsupported yet" — there is no slot for them to arrive through, and the schema rejects
81
82
each one by name with the alternative to use instead:
82
83
@@ -92,6 +93,50 @@ fails at authoring time with a prescription rather than being dropped in silence
92
93
93
94
---
94
95
96
+
## Relabelling a vendor field
97
+
98
+
Replacing a field through `fields` takes it over whole: its type, its options and its
99
+
rules become yours, and the owner's next version no longer reaches it. To change only
100
+
what a person *reads* — "Industry" shown as "Sector", a better help text — patch the
|**fieldPatches**|`Record<string, { label?: string; description?: string; inlineHelpText?: string; placeholder?: string; … }>`| optional |[EXPERIMENTAL — not enforced]Display patches of the target object's own fields, keyed by field name: change a vendor field's display properties (BASE_FIELD_DISPLAY_WHITELIST: label, description, help text, placeholder, option labels) without taking the field over, so its type, values and rules stay the vendor's and its upgrades still apply (ADR-0146 D10). Nothing applies a patch yet: the registry merge that does is rollout card N-23d, and until it lands the engine drops this slot at registration. Example: `fieldPatches: { industry: { label: 'Sector', inlineHelpText: 'The market the account sells into', options: { tech: { label: 'Technology' } } } }`. |
579
+
|**fieldPatches**|`Record<string, { label?: string; description?: string; inlineHelpText?: string; placeholder?: string; … }>`| optional | Display patches of the target object's own fields, keyed by field name: change a vendor field's display properties (BASE_FIELD_DISPLAY_WHITELIST: label, description, help text, placeholder, option labels) without taking the field over, so its type, values and rules stay the vendor's and its upgrades still apply (ADR-0146 D10). Applied by the registry merge (`mergeObjectDefinitions`) after the additive merges, on every object read: a tenant's own text keeps winning, and between two extensions the higher `priority` wins. A patch naming a field or option value the target does not have is refused at install and by `os validate`. Example: `fieldPatches: { industry: { label: 'Sector', inlineHelpText: 'The market the account sells into', options: { tech: { label: 'Technology' } } } }`. |
580
580
|**label**|`string`| optional | Override label for the extended object |
581
581
|**pluralLabel**|`string`| optional | Override plural label for the extended object |
582
582
|**description**|`string`| optional | Override description for the extended object |
0 commit comments