Extend another model
Updated
You never edit another model's files. You extend them additively from your model: extra fields, a Chain of Command link, a menu item grafted into their group.
Note
Bump your
modelVersion, not theirs. The extension lives with you. The tenant compares versions; without a bump your model is not re-applied.metaIdof existing rows does not change.
How to#
Preconditions, or the import refuses:
- A dependency on the owner model in your
model.json. - Your layer is strictly above theirs.
Core/and a sealed model are extended the same way — never edited.
A field on their object is an extension aggregate named
<Target>.<YourModel>:
DictionaryExtensions/Country.WMS/Country.WMS.extension.json (documents:
DocumentExtensions/). The field's modelId is yours. Turning your model off
removes the field from the effective set.
The field does not appear on the generated target class. record.CustomsCode
does not compile. IDictionaryManager<LegalEntity> does not return it. Read
it from the raw bag (IDataService.GetByIdAsync indexer). Write it with
Db.UpdateAsync repeating required fields — an update rewrites the row.
Put an enum into that bag as a number.
Lookup columns on their dictionary or document are the same aggregate:
lookupPropertiesAdd / lookupPropertiesHide CSVs on object. The runtime
appends extras and drops hides in layer order; the owner's lookupProperties
is unchanged. In the designer, with your working model selected, the Lookup
properties tab writes that overlay (ticks save immediately).
A handler, service, command, driver, or posting on their object is
Chain of Command: [ExtensionOf("ObjectName")] on the
class, and next / nextAsync from every override. Missing next is
ZOCOC001 (events) / ZOCOC002 (services) / ZOCOC003 (command, posting,
driver). Missing [ExtensionOf] on a foreign object is ZOCOC004. [ExtensionOf]
on an object you own is ZOCOC004 as well. The owner is link 0 and does
not call next.
A menu item in their group sets parentMetaId to that group. That is also
a dependency.
Tip
Several posting scripts on one subtype are a horizontal list (
executionOrder), not an onion. Wrap an existing posting with CoC on that script. Do not add a third posting "on top" of theirs unless you own a new accounting goal.
What's not there yet#
There is no way to delete or rename a field of another model from yours. You can hide it in a form layout. You cannot take it off the table.