
Model fields cookbook
Model fields configure display of columns that already exist in the database. Create a new column via extra fields.
Reference: Model fields.
Goal
Group fields into sections, set xtype and width, hide technical columns. Vue order and entity forms load the visible list from the server.
Models
| model (short name) | Manager form |
|---|---|
msOrder | Order card |
msOrderAddress | Address on order |
msOrderProduct | Order line item |
msVendor | Vendor |
msProductData | Product data (partial) |
Visible list vs full CRUD
| Request | Purpose |
|---|---|
GET /api/mgr/model-fields/visible/{model} | Fields for Vue forms (visible only) |
GET /api/mgr/model-fields?model={model} | Full list in “Model fields” utility |
PUT /api/mgr/model-fields/{id} | Single field metadata |
PUT /api/mgr/model-fields/ranks | Field order (drag-and-drop) |
The order card calls visible/msOrder and visible/msOrderAddress on load.
Case: “Additional” section on an order
- Utilities → Model fields → model msOrder.
- Create a section:
- key
extra_info - label “Additional”
sort_orderas needed
- key
- Open a field (e.g.
comment) → section Additional,visible = true, width 12. - Drag sections and fields to the order you need.
Section order: PUT /api/mgr/model-fields/sections/ranks. Field order: PUT /api/mgr/model-fields/ranks.
Section sorting
If section drag-and-drop does not persist, see issue #611.
Case: hide a technical field
- Find the field in the list (e.g.
tokenorproperties). - Clear Visible or move it to a section you do not show on the form.
- Confirm it is absent from
GET .../visible/msOrder.
Relation to page-fields
| System | Table | API | Scope |
|---|---|---|---|
| Model fields | ms3_model_fields | /api/mgr/model-fields/* | MS3 models (order, vendor, …) |
| Page fields | ms3_product_fields | /api/mgr/config/page-fields/product_data | Product “Data” tab only |
An extra field on msProductData creates the column and a row in ms3_product_fields. Layout of that tab is edited in Product fields, without duplicating model-field entries.
API appendix
Sections
GET /api/mgr/model-fields/sections/{model}
POST /api/mgr/model-fields/sections
PUT /api/mgr/model-fields/sections/{id}
PUT /api/mgr/model-fields/sections/ranks
DELETE /api/mgr/model-fields/sections/{id}Visible fields
GET /api/mgr/model-fields/visible/msOrderCombo for combo xtype
GET /api/mgr/model-fields/combo-options/{model}/{field_name}All write endpoints require mssetting_save.
Troubleshooting
| Symptom | Action |
|---|---|
| 403 | MS3 policies, see issue #613 |
| Field not on form | visible = false or not in visible response |
| Confusion with extra fields | Extra creates a column. Model fields are UI only. See #214 |
| Changes not visible | Refresh the entity card |
See Manager cookbooks.
