Візуальний конструктор об'єкта · гід Visual object constructor · guide

UI-конструктор — опишіть об'єкт без коду UI Constructor — describe an object with no code

UI-конструктор — це форма з розділами, чекбоксами й випадними списками, якою повністю описується довідник, документ, регістр чи звіт: тип кожного поля, посилання на інші об'єкти, представлення й правила задаються кліками, без єдиного рядка коду. Відкрити конструктор найшвидше можна з картки на діаграмі /diagram: клік по ній (або кнопка «+ New entity») одразу відкриває його для цього об'єкта. У цьому гіді ми з нуля збираємо конструктором конфігурацію «Квітковий магазин» — чотири об'єкти, жодного рядка коду.

The UI Constructor is a form with collapsible sections, checkboxes and dropdowns that fully describes a dictionary, document, register or report: every field's type, its references to other objects, views and rules are all set by clicking, without a single line of code. The fastest way to open the constructor is from a card on the /diagram diagram: clicking it (or the "+ New entity" button) opens it right away for that object. This guide builds a "Flower Shop" configuration from scratch with the constructor — four objects, not one line of code.

10 розділів 10 sections 1 наскрізний приклад 1 running example EN · UK

Що таке UI-конструкторWhat the UI Constructor is

UI-конструктор показує довідник, документ, регістр чи звіт як набір розділів, що розгортаються: «Основна інформація», «Поля», «Представлення», «Правила»... Кожне значення в них — поле вводу, чекбокс чи випадний список, і кожна зміна одразу зберігається кнопкою Save. Цей гід — повністю про роботу з конструктором: від відкриття порожнього об'єкта до готової конфігурації з чотирьох зв'язаних сутностей.

The UI Constructor shows a dictionary, document, register or report as a set of collapsible sections: "Basic information", "Fields", "Views", "Rules"... Every value in them is an input, a checkbox, or a dropdown, and every change is saved with the Save button. This guide is entirely about working with the constructor: from opening an empty object to a finished configuration of four connected entities.

The UI Constructor panel open on the Flowers object
UI-конструктор: розділи розгортаються, кожне значення — поле форми
The UI Constructor: sections expand, every value is a form field

Наскрізний приклад цього гіда

This guide's running example

Щоб кожен розділ був конкретним, а не абстрактним, ми конструктором збираємо одну невелику, але повноцінну конфігурацію — квітковий магазин — і проходимо через усі чотири типи об'єктів:

To keep every section concrete rather than abstract, we use the constructor to build one small but complete configuration — a flower shop — walking through all four object types:

🌷
Flowers — довідник
Flowers — dictionary

Товари: категорія, ціна, залишок, фото

Products: category, price, stock, photo

🧾
Orders — документ
Orders — document

Замовлення клієнта з табличною частиною позицій

A customer order with a line-items table

📦
FlowerStock — регістр
FlowerStock — register

Накопичення залишків по кожній квітці

Accumulates stock balances per flower

📊
StockReport — звіт
StockReport — report

Залишки на складі з діаграмою

Warehouse balances with a chart

💡

Усі скріншоти цього гіда зроблені в реальному застосунку — кожна дія, описана нижче, справді виконувалась у Leon для побудови показаної конфігурації.

Every screenshot in this guide comes from the real running app — each step described below was actually performed in Leon to build the configuration shown.

01Відкрити конструкторOpen the constructor

Конструктор прив'язаний до конкретної конфігурації, тому спершу потрібна конфігурація — існуюча або нова.

The constructor belongs to a specific configuration, so you need one first — existing or brand new.

  1. Якщо конфігурації ще немає — відкрийте перемикач конфігурацій у верхній панелі → + New configuration → введіть назву → Create. Застосунок одразу перейде на сторінку /backup нової, порожньої конфігурації. If you don't have one yet — open the configuration switcher in the top bar → + New configuration → type a name → Create. The app jumps straight to the /backup page of the new, empty configuration.
  2. У лівому меню відкрийте Configuration diagram і натисніть + New entity → Empty object (або оберіть один із понад сотні готових шаблонів, згрупованих за типом і бізнес-категорією — вибір лише заповнює конструктор готовими полями, які так само можна редагувати). In the left sidebar open Configuration diagram and click + New entity → Empty object (or pick one of the well over a hundred ready-made templates, grouped by type and business category — picking one only pre-fills the constructor with a working set of fields you can still edit).
  3. Відкривається сама панель конструктора — розділи «Basic information», «Fields» і решта, описані далі в цьому гіді. The constructor panel itself opens — the "Basic information", "Fields" and other sections covered by the rest of this guide.
New entity menu with Empty object and template categories
Меню «New entity»: порожній об'єкт або один із готових шаблонів
The "New entity" menu: an empty object or one of the ready-made templates
🧭

Той самий конструктор відкривається і для вже існуючого об'єкта — кліком по його картці на діаграмі, або з повного редактора /config на вкладці «UI Builder». Це рівнозначні шляхи до однієї й тієї самої форми.

The same constructor opens for an existing object too — by clicking its card on the diagram, or from the full /config editor's "UI Builder" tab. Both are equivalent paths to the exact same form.

02Основна інформаціяBasic information

Перший розділ конструктора — паспорт об'єкта: як він зветься в базі даних, яким показується користувачу, і який це тип сутності.

The constructor's first section is the object's identity card: what it's called in the database, how it's shown to users, and what kind of entity it is.

ПолеFieldПризначенняPurpose
System nameЛатиниця без пробілів — стає назвою таблиці в БД. Зміна пізніше перейменовує таблицю, тож краще визначитись одразу.Latin letters, no spaces — becomes the database table name. Changing it later renames the table, so it's worth settling early.
Object typeDictionary / Document / Register / Report. Не можна змінити після створення — обирайте уважно.Dictionary / Document / Register / Report. Cannot be changed after creation — choose carefully.
Display nameНазва для людей — те, що бачить користувач у меню й списках.The human-facing name — what the user sees in menus and lists.
Default sortingПорядок рядків за замовчуванням, напр. Name або Date DESC. Користувач завжди може сортувати клікom по колонці — це лише стартовий порядок.The default row order, e.g. Name or Date DESC. Users can always sort by clicking a column — this is only the starting order.

Для Document тут же є прапорець Supports posting (проведення — вмикає рухи по регістрах, розділ 05), для Dictionary — System dictionary (Seed Data), який позначає, що дані довідника експортуються разом із конфігурацією.

For Document the same section has a Supports posting checkbox (enables register movements, section 05); for Dictionary it's System dictionary (Seed Data), which marks the dictionary's data to be exported together with the configuration.

Basic information section filled in for the Flowers dictionary
Основна інформація довідника Flowers — тип Dictionary, назва «Квіти»
Basic information for the Flowers dictionary — type Dictionary, display name "Квіти"
✅

Порада: новий об'єкт не стартує з нуля — поле Name (String, обов'язкове) уже є в розділі «Fields». Не додавайте своє — просто позначте, де воно показується (List / Form), і відредагуйте його за потреби.

Tip: a new object doesn't start empty — a Name field (String, required) is already sitting in the "Fields" section. Don't add another one — just tick where it shows (List / Form) and edit it if needed.

03ПоляFields

Розділ Fields — таблиця всіх полів об'єкта. + Add field відкриває модальне вікно поля: тип даних, обов'язковість, видимість, і — для деяких типів — додаткові налаштування.

The Fields section is a table of every field on the object. + Add field opens the field modal: data type, required flag, visibility, and — for some types — extra settings.

12 типів даних

12 data types

ТипTypeКоли використовуватиWhen to use it
StringКороткий однорядковий текст (є Maximum length)Short single-line text (has Maximum length)
TextБагаторядковий текст без форматуванняMulti-line plain text
Rich textТекст із форматуванням (WYSIWYG-редактор)Formatted text (WYSIWYG editor)
IntegerЦіле число (є MIN / MAX в Advanced)Whole number (has MIN / MAX under Advanced)
NumberДробове число (є Decimal places, а також TOTAL — автопідсумок по табличній частині)Decimal number (has Decimal places, plus TOTAL — an auto-sum across a table part)
DateДата; за замовчуванням можна ввести todayA date; the default accepts the literal today
Date & timeДата з часомA date with a time component
TimeЛише часTime only
BooleanПрапорець так/ніA yes/no flag
EnumСписок варіантів із власним кольором для кожного — статуси, категорії (розділ нижче)A list of options, each with its own color — statuses, categories (see below)
FileФайл або зображенняA file or image
→ ReferenceПосилання на інший об'єкт конфігурації (розділ 04)A link to another configuration object (section 04)

Enum — варіанти з кольором

Enum — colored options

Для поля Category довідника Flowers обрано тип Enum: кожен варіант — це пара «ключ / підпис» плюс колір чипа (той самий, що потім використовується для стадій канбану чи міток у списках).

The Category field on the Flowers dictionary uses the Enum type: each option is a key/label pair plus a chip color (the very same color palette later reused for kanban stages or list badges).

Field modal configuring the Category enum field with four colored options
Поле Category (Enum): чотири варіанти, кожен зі своїм кольором
The Category field (Enum): four options, each with its own color

Обов'язковість, видимість, розширені налаштування

Required, visibility, advanced settings

Кожне поле незалежно вмикається у списку (In list) і у формі редагування (In edit form), з опціональним порядком показу. Advanced settings розкриває: Read-only, Computed field з формулою (напр. Quantity * Price), валідатори (MIN/MAX/MINLEN/regex) і — лише для Number — автопідсумок TOTAL по табличній частині.

Each field is independently switched on for the list (In list) and the edit form (In edit form), with an optional display order. Advanced settings reveals: Read-only, a Computed field with a formula (e.g. Quantity * Price), validators (MIN/MAX/MINLEN/regex), and — for Number only — the TOTAL auto-sum across a table part.

Completed fields table for the Flowers dictionary
Готовий список полів Flowers: Name, Category, Price, Stock, Photo
The finished Flowers field list: Name, Category, Price, Stock, Photo

04Посилання між об'єктамиReferences between objects

Тип → Reference to object перетворює звичайне поле на живий зв'язок з іншим об'єктом — так документи посилаються на довідники, а звіти й регістри — на джерела своїх даних.

The → Reference to object type turns an ordinary field into a live link to another object — this is how documents point at dictionaries, and reports and registers point at their data sources.

Приклад: поле Flower у табличній частині Lines документа Orders. Обравши тип Reference, з'являється додатковий блок:

Example: the Flower field inside the Orders document's Lines table part. Picking the Reference type reveals an extra block:

  • References object — системна назва цільового об'єкта (з підказкою наявних об'єктів);References object — the target object's system name (with a hint of existing objects);
  • Display format — як показувати вибране значення, напр. {Name}; клікабельні чипи одразу під полем вставляють імена полів цільового об'єкта, щоб не набирати вручну;Display format — how the picked value is rendered, e.g. {Name}; clickable chips right below insert the target object's field names so you don't have to type them by hand;
  • в Advanced settings — Allow selecting multiple values та фільтри «лише групи» / «без груп» для ієрархічних довідників.under Advanced settings — Allow selecting multiple values and "groups only" / "non-groups only" filters for hierarchical dictionaries.
Field modal configuring a Reference field pointing at Flowers, with clickable field chips
Поле Flower типу Reference → Flowers, з форматом показу {Name}
The Flower field, type Reference → Flowers, with the {Name} display format

Це працює однаково і для полів у шапці об'єкта, і для полів усередині табличних частин (розділ 05).

This works the same way for header fields and for fields inside table parts (section 05).

05Табличні частини, нумерація й рухиTable parts, numbering & movements

Три розділи конструктора, доступні лише коли обрано тип Document.

Three constructor sections available only when the object type is Document.

Табличні частини

Table parts

Підтаблиця всередині документа — рядки замовлення, послуги в наряді, позиції рахунку. + Add у заголовку розділу відкриває маленьке вікно з системною назвою й назвою для показу (напр. Lines / «Позиції замовлення»). Новостворена частина одразу розгортається — і в ній працює той самий + Add field, що й для полів об'єкта.

A sub-table living inside a document — order lines, service items on a work order, invoice rows. + Add in the section header opens a small dialog for the system name and display name (e.g. Lines / "Order lines"). A newly created table part expands immediately — and the very same + Add field you already know works inside it.

Lines table part with three fields: Flower reference, Quantity, Price
Табличну частина Lines: Flower (посилання), Quantity, Price
The Lines table part: Flower (reference), Quantity, Price

Нумерація

Numbering

Автоматичний номер документа при створенні — без ручного вводу і без дублікатів. Розділ стартує вимкненим (+ Enable) і після ввімкнення пропонує розумні значення за замовчуванням, які видно одразу в прикладі результату під полями: Prefix, Number length, Counter reset (без скидання / щороку / щомісяця), Field to store the number.

An automatic document number on creation — no manual typing, no duplicates. The section starts disabled (+ Enable) and once turned on offers sensible defaults, with a live result preview right under the fields: Prefix, Number length, Counter reset (never / yearly / monthly), Field to store the number.

Numbering section configured with prefix ORD- and length 5
Нумерація Orders: префікс ORD-, довжина 5 → ORD-00001
Orders numbering: prefix ORD-, length 5 → ORD-00001

Рухи по регістрах

Register movements

Найпотужніший інструмент документа: MOVEMENTS з'являється лише коли ввімкнено Supports posting (розділ 02), і зв'язує документ із регістром так, що проведення документа автоматично змінює накопичені залишки. Заповніть один рух:

A document's most powerful tool: MOVEMENTS only appears once Supports posting is on (section 02), and ties the document to a register so that posting it automatically changes accumulated balances. Fill in one movement:

ПолеFieldЗначення в прикладіExample value
Target registerFlowerStock
DirectionExpense — квітка йде зі складу під час продажуExpense — the flower leaves the stock on a sale
Table part (foreach)Lines
Loop variableline
Condition (where)Quantity > 0
Movement valuesпари «поле регістру = вираз»: Flower = line.Flower, Quantity = line.Quantity"register field = expression" pairs: Flower = line.Flower, Quantity = line.Quantity
Register movements configured for Orders posting to FlowerStock
Рух Orders → FlowerStock: expense по кожному рядку Lines
The Orders → FlowerStock movement: an expense for every Lines row
⚙️

Під капотом рух компілюється у правила on_post / on_unpost / on_delete — вручну їх писати не потрібно. Поля DocumentId / DocumentType / DocumentLineId / Posted додаються в регістр автоматично, якщо там є відповідні колонки.

Under the hood the movement compiles into on_post / on_unpost / on_delete rules — you never write those by hand. The DocumentId / DocumentType / DocumentLineId / Posted fields are added to the register automatically wherever matching columns exist.

06ПредставленняViews

Один і той самий набір записів можна показати п'ятьма способами. Default view обирає, який відкривається спершу; кожен спосіб має власний під-розділ із налаштуваннями.

The same set of records can be shown five different ways. Default view picks which one opens first; each way has its own settings sub-section.

ПредставленняViewНалаштуванняSettings
Listбез додаткових налаштувань — звичайна таблицяno extra settings — a plain table
KanbanStatus field + список Stages (ключ / підпис / колір)
Calendarполя дати початку/кінця/заголовка/кольору/ресурсу, вигляд за замовчуванням (Month/Week/Day)start/end/title/color/resource fields, default look (Month/Week/Day)
Timelineполя початку/кінця/заголовка/кольору/групуванняstart/end/title/color/group-by fields
GalleryImage field + Title field + Description field

Для довідника Flowers обрано Gallery, для документа Orders — Kanban зі статусом замовлення як колонками дошки:

The Flowers dictionary uses Gallery, the Orders document uses Kanban with the order status as the board's columns:

Gallery view configured with Photo as the image field
Gallery для Flowers
Gallery for Flowers
Kanban view configured with Status field and three stages
Kanban для Orders
Kanban for Orders

07Правила й діїRules & actions

Розділи Rules і Actions додають поведінку: правила спрацьовують автоматично на подію, дії — це кнопки, які натискає користувач.

The Rules and Actions sections add behaviour: rules fire automatically on an event, actions are buttons a user clicks.

Правило: тригер + блоки

A rule: trigger + blocks

+ Add у заголовку «Rules» відкриває редактор правила: назва, необов'язковий опис, тригер (подія + за потреби — конкретна табличная частина), і список блоків.

The + Add button in the "Rules" header opens the rule editor: a name, an optional description, a trigger (event + optionally a specific table part), and a list of blocks.

ON INSERTON UPDATEON DELETEON POSTON UNPOST

Блок — один крок логіки. «Конструктор» блоків доступний прямо в модальному вікні — без написання коду:

A block is one step of logic. The block "constructor" is available right in the modal — no code required:

LET — VariableSUM/AVG — AggregateQUERY — Single value UPDATEINSERTDELETE VALIDATEIF — BranchFOREACH — Loop NOTIFYMESSAGESTOPBREAKCONTINUE

У прикладі — просте, але корисне правило на довіднику Flowers: заборонити зберігати квітку з нульовою чи від'ємною ціною.

The example is a simple but useful rule on the Flowers dictionary: refuse to save a flower with a zero or negative price.

Rule editor: PriceMustBePositive, ON INSERT, one VALIDATE block
Правило PriceMustBePositive: ON INSERT → VALIDATE Price > 0
The PriceMustBePositive rule: ON INSERT → VALIDATE Price > 0

Дії — кнопки для користувача

Actions — buttons for the user

Розділ Actions влаштований так само (назва, рівень показу — Record / List / Header, іконка, умова показу, текст підтвердження, блоки), але описує не автоматичну реакцію, а кнопку, яку користувач тисне свідомо — «Сформувати рахунок», «Позначити виконаним» тощо.

The Actions section works the same way (a name, display level — Record / List / Header, an icon, a display condition, a confirmation prompt, blocks), but describes not an automatic reaction, rather a button the user deliberately clicks — "Generate invoice", "Mark as done", and so on.

08Регістр і звітRegister & report

Два спеціалізовані типи об'єкта з власними розділами конструктора: регістр, що накопичує рух, і звіт, що його показує.

Two specialised object types with their own constructor sections: a register that accumulates movements, and a report that shows them.

Налаштування регістру

Register settings

Реєстр — це, по суті, таблиця накопичених значень. У нього є звичайний розділ Fields (тут — Date, Flower як Reference, Quantity), плюс окремий розділ Register settings:

A register is, at heart, a table of accumulated values. It has the same ordinary Fields section (here: Date, Flower as a Reference, Quantity), plus a separate Register settings section:

ПолеFieldЗначенняMeaning
Register typeAccumulation (сума рухів) або Information (останній стан)Accumulation (a running sum of movements) or Information (the latest state)
Period fieldПоле дати, за яким відраховується періодThe date field the period is measured against
DimensionsРозрізи, за якими рахуються залишки окремо — тут FlowerThe cuts balances are tracked separately by — here Flower
ResourcesЧислові величини, що накопичуються — тут QuantityThe numeric quantities that accumulate — here Quantity
Register settings: type Accumulation, period field Date, dimension Flower, resource Quantity
FlowerStock: Accumulation, DIM Flower, RES Quantity
FlowerStock: Accumulation, DIM Flower, RES Quantity

Конфігурація звіту

Report configuration

Звіт читає дані з регістру й показує їх у вигляді таблиці та/або діаграми. Поля звіту (тут — Flower, теж Reference) — це параметри-фільтри, які користувач заповнює перед побудовою.

A report reads data from a register and shows it as a table and/or a chart. A report's fields (here — Flower, also a Reference) are the filter parameters a user fills in before running it.

ПолеFieldЗначення в прикладіExample value
Data sourceFlowerStock
Query typeBalance — залишок на дату (альтернатива — Turnovers, обороти за період)Balance — the balance as of a date (alternatively, Turnovers — movement totals over a period)
Group byFlower
Chart typeBar / Line / Pie / AreaBar / Line / Pie / Area
X axis / Y valuesFlower / Quantity
Report configuration: source FlowerStock, balance query, bar chart by Flower/Quantity
StockReport: джерело FlowerStock, стовпчикова діаграма Flower × Quantity
StockReport: source FlowerStock, a bar chart of Flower × Quantity

09Результат на діаграміThe result, on the diagram

Кожне збереження в конструкторі одразу оновлює картку на діаграмі /diagram — це зручний спосіб побачити результат роботи конструктора цілком, об'єкт за об'єктом.

Every save in the constructor immediately updates the matching card on the /diagram diagram — a convenient way to see the constructor's output as a whole, object by object.

Поля стають рядками картки, посилання (розділ 04) — стрілками між картками, підписаними шляхом до поля; регістр показує позначки DIM: / RES:, а документ — блок ⊞ з табличною частиною. Ось усі чотири об'єкти цього гіда після того, як конструктор попрацював над кожним:

Fields become rows on the card, references (section 04) become arrows between cards labeled with the field's path; a register shows DIM: / RES: marks, and a document shows a ⊞ block for its table part. Here are all four objects from this guide after the constructor did its work on each:

Configuration diagram with four connected objects
Готова конфігурація «Квітковий магазин»: довідник → документ → регістр → звіт
The finished "Flower Shop" configuration: dictionary → document → register → report

Клік по будь-якій картці знову відкриває конструктор у режимі редагування — все, що описано в розділах 02–08, застосовується й до вже збережених об'єктів.

Clicking any card opens the constructor again, in edit mode — everything described in sections 02–08 applies to already-saved objects too.

10Поради й підводні каменіTips & pitfalls

Кілька речей, які легко проґавити вперше.

A handful of things that are easy to miss the first time.

✅

Збереження одразу синхронізує таблицю БД. Кнопка Save не лише запам'ятовує зміни в конструкторі — вона одразу створює або оновлює відповідну таблицю в базі даних. Помилки на кшталт «стовпець вказано двічі» означають конфлікт у структурі полів — виправте його ще до збереження.

Saving syncs the database table immediately. The Save button doesn't just remember the constructor's changes — it creates or updates the matching database table right away. Errors like "column specified more than once" mean a field-structure conflict — fix it before saving.

⚠️

Тип об'єкта незворотний. Обрали Dictionary, а мали на увазі Document? Доведеться створити об'єкт заново — поле Object type заблоковане одразу після першого збереження.

Object type is one-way. Picked Dictionary but meant Document? You'll need to recreate the object — the Object type field locks immediately after the first save.

🔤

Системні назви — лише латиниця. Об'єкти, поля й табличні частини використовуються у формулах і правилах як голі токени (this.Price), тому дозволені лише літери, цифри й _ — без дефісів і кирилиці. Дефіс у назві парситься як віднімання.

System names are Latin-only. Objects, fields and table parts are referenced in formulas and rules as bare tokens (this.Price), so only letters, digits and _ are allowed — no hyphens, no Cyrillic. A hyphen in a name would parse as subtraction.

🧩

Шаблони — це прискорення, а не обмеження. Обраний шаблон лише заповнює початковий стан конструктора — після цього все так само можна редагувати, додавати чи прибирати поля.

Templates are a head start, not a limit. Picking one only pre-fills the constructor's starting state — everything can still be edited, added to, or removed afterwards.

🎯

Немає єдиного правильного порядку. Цей гід іде Dictionary → Document → Register → Report, бо так найлегше побачити зв'язки. У реальній роботі часто зручніше почати з довідників, потім документи з рухами, і лише тоді — регістри та звіти під конкретну потребу в аналітиці.

There's no single right order. This guide goes Dictionary → Document → Register → Report because it's the easiest way to see the connections. In real work it's often more natural to start with dictionaries, then documents with movements, and only then add the registers and reports a specific reporting need calls for.