Create a model
Updated
A model is one deliverable of the business layer: a top-level folder with its own metadata, scripts, and menu. Everything you create lives in some model.
Note
The tenant compares
MetaPackages.PackageVersiontomodelVersioninmodel.json. Equal versions skip the model entirely. A new field, script, or menu item with the same version never arrives.
How to#
Create <Name>/model.json:
{
"kind": "Model",
"object": {
"modelType": "Custom",
"description": "What this module is, in one sentence",
"modelVersion": "1.0.0",
"publisher": "Your publisher",
"isSystem": false,
"isSealed": false,
"isEnabled": true,
"metaId": "<new guid>",
"name": "<Name>",
"modelId": "00000000-0000-0000-0000-000000000000",
"layerId": 2
},
"dependencies": []
}
nameis PascalCase Latin (WMS,PayrollUA).- On the model itself
modelIdis zeros. Every object inside the model setsmodelIdto this model'smetaId. layerIdis the model's role, and it decides who may extend whom (extensions only look down):
| layerId | Layer | Who puts models here |
|---|---|---|
| 0 | System | The platform (Core) — not you |
| 1 | Base | Product application models |
| 2 | Solution | Industry / partner solutions |
| 3 | Customization | The implementation |
| 4 | User | One stand's local changes |
Declare a dependency for anything you use from another model: a reference EDT, a posting into its register, an extension field, a handler on its object, a menu item grafted into its group.
"dependencies": [
{
"dependsOnModelMetaId": "<other model guid>",
"minVersion": "1.0.0",
"name": "<Name>-><Other>",
"metaId": "<new guid>"
}
]
Do not declare a dependency on Core. Do not create cycles. A model's layer
must be greater than or equal to each dependency's layer.
Then add Menu/menu.json with the model's root group, and under it subgroups
by kind — Dictionaries, Documents, Registers, Reports — only the ones
you will use. The ribbon draws one nesting level as columns. Object items
hang off the kind subgroup, not off the root.
Tip
Folders such as
Dictionaries/,Documents/,EDTs/appear when you need them. Empty folders are noise.
On a dev stand the model is created enabled. Shipped to a tenant it arrives disabled; turning it on is a separate, validated action.
What's not there yet#
Core/ is not a model you edit in the workspace. The sync rewrites it from
the database. Change the kernel in the platform sources.