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.
Що таке 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.
Наскрізний приклад цього гіда
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.
-
Якщо конфігурації ще немає — відкрийте перемикач конфігурацій у верхній панелі → + 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/backuppage of the new, empty configuration. - У лівому меню відкрийте 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).
- Відкривається сама панель конструктора — розділи «Basic information», «Fields» і решта, описані далі в цьому гіді. The constructor panel itself opens — the "Basic information", "Fields" and other sections covered by the rest of this guide.
Той самий конструктор відкривається і для вже існуючого об'єкта — кліком по його картці на діаграмі, або з повного редактора /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 type | Dictionary / 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.
Порада: новий об'єкт не стартує з нуля — поле 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).
Обов'язковість, видимість, розширені налаштування
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.
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та фільтри «лише групи» / «без груп» для ієрархічних довідників.underAdvanced settings—Allow selecting multiple valuesand "groups only" / "non-groups only" filters for hierarchical dictionaries.
Це працює однаково і для полів у шапці об'єкта, і для полів усередині табличних частин (розділ 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.
Нумерація
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.
Рухи по регістрах
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 register | FlowerStock | ||
Direction | Expense — квітка йде зі складу під час продажуExpense — the flower leaves the stock on a sale | ||
Table part (foreach) | Lines | ||
Loop variable | line | ||
Condition (where) | Quantity > 0 | ||
Movement values | пари «поле регістру = вираз»: Flower = line.Flower, Quantity = line.Quantity"register field = expression" pairs: Flower = line.Flower, Quantity = line.Quantity | ||
Під капотом рух компілюється у правила 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 | ||
| Kanban | Status 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 | ||
| Gallery | Image 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:
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.
Блок — один крок логіки. «Конструктор» блоків доступний прямо в модальному вікні — без написання коду:
A block is one step of logic. The block "constructor" is available right in the modal — no code required:
У прикладі — просте, але корисне правило на довіднику Flowers: заборонити зберігати квітку з нульовою чи від'ємною ціною.
The example is a simple but useful rule on the Flowers dictionary: refuse to save a flower with a zero or negative price.
Дії — кнопки для користувача
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 type | Accumulation (сума рухів) або 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 | ||
Конфігурація звіту
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 source | FlowerStock | ||
Query type | Balance — залишок на дату (альтернатива — Turnovers, обороти за період)Balance — the balance as of a date (alternatively, Turnovers — movement totals over a period) | ||
Group by | Flower | ||
Chart type | Bar / Line / Pie / AreaBar / Line / Pie / Area | ||
X axis / Y values | 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:
Клік по будь-якій картці знову відкриває конструктор у режимі редагування — все, що описано в розділах 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.