ZuloOne
English
Sign in
Menu

Create a dictionary

Updated

A dictionary is a catalog: customers, items, warehouses. Files live in your model. Every new row gets its own GUID. Names are PascalCase Latin.

Note

Do not declare ID. The server creates it (and ParentId when isHierarchical is true). Do not declare author fields either — CreatedByMetaId / ModifiedByMetaId are filled from ICurrentUser.

How to#

1. Number sequence — NumberSequences/<Name>Seq.json.

2. The dictionary — Dictionaries/<Name>/<Name>.object.json. Point numberSequenceMetaId at the sequence. Give Name (or whatever you search by) as defaultSearchProperty. displayFormat ({Name} ({Code})) is the closed reference text. lookupProperties is a CSV of field names for the dropdown columns (the Lookup properties tab in the designer); empty means Code plus the display-format fields. Another model overlays extras and hides on its extension (lookupPropertiesAdd / lookupPropertiesHide), not by editing this CSV.

Scalar field: baseType is String, Integer, Long, Decimal, DateTime, Boolean, or Guid, plus length / precision+scale.

Warning

Integer is Integer, not Int. Import accepts Int silently. Schema sync then fails with "Base type 'Int' is not in the catalog": the object exists, the table does not.

A reference field is an EDT first (edtType: "Reference" + referenceDictionaryMetaId), then edtMetaId on the field instead of baseType. One fieldName once.

caption is { "en": "…", "ru": "…" } — en is the base, the rest are translations. A plain string is valid when there is nothing to translate.

3. Event handler — Dictionaries/<Name>/Events/<Name>EventHandler.*. An empty template is normal. The owner is link 0 of the chain and does not call next. See Write an event handler.

4. Menu item in the model's Dictionaries subgroup — Add a menu item.

5. Bump modelVersion in the same change.

Tip

An optional Boolean is generated non-nullable. Unset equals false. Name the flag so the working value is false: IsDisabled, not IsActive. A defaulting event will not save you: NewRecord<T>() is built in memory and never hits the event.

What's not there yet#

Do not invent a CreatedBy of your own. It would disagree with the system columns on rows that arrived from a job, an import, or another script.

Where next#

Was this page helpful?