Two modes:
- JSON DSL — from the form JSON definition
- From object (
-FromObject) — automatically from 1C object metadata using the ERP preset
When designing a form from scratch (5+ elements or vague requirements) — call
/form-patternsto load the reference. For simple forms (1–3 fields) — not needed.
Parameters
| Parameter | Required | Description |
|---|---|---|
| JsonPath | mode 1 | Path to the form JSON definition |
| OutputPath | yes | Path to the output Form.xml |
| FromObject | mode 2 | Flag (no value) — generation from object metadata |
Command
# Режим JSON DSL
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/form-compile.ps1" -JsonPath "<json>" -OutputPath "<Form.xml>"
# Режим from-object (объект и purpose выводятся из OutputPath; Document и Catalog)
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/form-compile.ps1" -FromObject -OutputPath "<.../TypePlural/ObjectName/Forms/FormName/Ext/Form.xml>"
JSON DSL
Structure
{
"title": "Заголовок формы",
"properties": { "windowOpeningMode": "LockOwnerWindow" },
"events": { "OnCreateAtServer": "ПриСозданииНаСервере" },
"elements": [ ... ],
"attributes": [ ... ],
"commands": [ ... ],
"parameters": [ ... ]
}
title— form title (string or{ru, en})properties— form properties:windowOpeningMode,commandBarLocation,width,heightand others (full list —references/form-properties.md)events— form event handlers:{ "ИмяСобытия": "ИмяПроцедуры" }excludedCommands— remove standard form commands:["Reread", "Copy"]
Elements (the key determines the type)
| Key | Element | Key value |
|---|---|---|
group |
Regular group | orientation: vertical / horizontalIfPossible / alwaysHorizontal |
input |
Input field | name |
check |
Check box | name |
radio |
Radio button | name |
label |
Label | name (text — in title) |
labelField |
Label field (value without editing) | name |
table |
Table | name |
columnGroup |
Column group (inside columns tables) |
horizontal / vertical / inCell |
pages / page |
Pages / page | name |
button |
Button | name |
buttonGroup |
Button group (in a command bar or submenu) | name |
popup |
Submenu | name |
cmdBar |
Command bar in the form layout | name |
autoCmdBar |
Command bar of the form itself | name (usually ФормаКоманднаяПанель) |
picture |
Picture | name |
picField |
Picture field | name |
Tabular document, HTML, calendar, charts and other special fields — see the index below.
General properties of elements
| Key | Description |
|---|---|
name |
Element name, if different from the type key value. Names are unique within the form |
title |
Title (string or {ru, en}); "" — no title |
tooltip |
Tooltip |
visible: false / enabled: false / readOnly: true |
Hide / make unavailable / read-only |
titleLocation |
none / left / right / top / bottom / auto |
width / height |
Size |
horizontalStretch / verticalStretch |
Stretch |
autoMaxWidth: false |
Remove the width limit (the field stretches to the full available width) |
events |
Handlers: { "OnChange": "ИмяОбработчика" }; null instead of the name — the name by template <Элемент><Событие> |
Events
Names are case-sensitive.
Form: OnCreateAtServer, OnOpen, BeforeClose, OnClose, NotificationProcessing, ChoiceProcessing, OnReadAtServer, BeforeWriteAtServer, OnWriteAtServer, AfterWriteAtServer, BeforeWrite, AfterWrite, FillCheckProcessingAtServer, BeforeLoadDataFromSettingsAtServer, OnLoadDataFromSettingsAtServer, ExternalEvent, Opening
input: OnChange, StartChoice, ChoiceProcessing, AutoComplete, TextEditEnd, Clearing, Creating, EditTextChange
picField: OnChange, StartChoice, ChoiceProcessing, Click, Clearing
check / radio: OnChange
table: OnStartEdit, OnEditEnd, OnChange, Selection, ValueChoice, BeforeAddRow, BeforeDeleteRow, AfterDeleteRow, BeforeRowChange, BeforeEditEnd, OnActivateRow, OnActivateCell, Drag, DragStart, DragCheck, DragEnd
label: Click, URLProcessing
picture: Click
labelField: OnChange, StartChoice, ChoiceProcessing, Click, URLProcessing, Clearing
button: Click
pages: OnCurrentPageChange
Input field (input)
| Key | Description |
|---|---|
path |
Data path: "Объект.Организация", "ИмяРеквизита" |
multiLine: true |
Multiline (comment) |
choiceButton / clearButton / dropListButton |
Selection, clear, dropdown buttons |
markIncomplete: true |
Highlight unfilled |
inputHint |
Placeholder in an empty field |
skipOnInput: true |
Skip when navigating with Enter/Tab |
maxWidth |
Width limit |
Selection list, mask, format, password and other buttons — references/input-fields.md.
Checkbox (check) and radio button (radio)
check: path, titleLocation (by default the title is on the right). The "switch" or "toggle" view — references/input-fields.md.
radio: path, radioButtonType (Auto / RadioButtons / Tumbler), columnsCount, choiceList:
{ "radio": "СпособКурса", "path": "Объект.СпособУстановкиКурса", "radioButtonType": "Tumbler",
"choiceList": [
{ "value": "Enum.СпособыКурса.EnumValue.Авто", "presentation": "Автоматически" },
{ "value": "Enum.СпособыКурса.EnumValue.Ручной", "presentation": { "ru": "Вручную", "en": "Manual" } }
] }
value — string, number, boolean or enumeration value "Enum.Тип.EnumValue.Значение"; presentation — variant text.
Label and label field (labelField)
label: title — text (supports markup, see references/tooltips-text.md), hyperlink: true — link.
labelField: path, hyperlink: true — value as a link.
Group (group)
| Key | Description |
|---|---|
behavior |
collapsible — collapsible, popup — pop-up; if not specified — regular |
showTitle: true |
Show title |
representation |
none / normal / weak / strong — group frame |
united: false |
Align fields only within the group, and not together with neighbouring ones |
children |
Nested elements |
Group collapsed on opening, intervals, title from data — references/groups-pages.md.
Table (table)
The table is bound to a table attribute (ValueTable, the tabular section of the object, dynamic list) — see “Element + attribute binding”.
| Key | Description |
|---|---|
path |
Path to the table attribute |
columns |
Columns — elements (input, check, labelField, picField, columnGroup); the column path is the table path plus the column name: Объект.Товары.Сумма, Данные.Сумма |
changeRowSet: true / changeRowOrder: true |
Allow adding/deleting / moving rows |
header: false |
Without header |
heightInTableRows |
Height in rows |
commandBarLocation |
None / Top / Bottom / Auto |
searchStringLocation |
None / Top / Bottom / CommandBar / Auto |
choiceMode: true |
Choice table (choice form) |
Footer with totals, tree, selection, column pinning, drag-and-drop — references/table-advanced.md.
columnGroup groups columns: title, showInHeader, children; inCell — multiple columns in one cell:
{ "table": "Список", "path": "Список", "columns": [
{ "columnGroup": "horizontal", "name": "ГруппаСрок", "title": "Срок", "children": [
{ "input": "ДатаНачала", "path": "Список.ДатаНачала" },
{ "input": "ДатаОкончания", "path": "Список.ДатаОкончания" } ] },
{ "input": "Комментарий", "path": "Список.Комментарий" }
] }
Pages (pages + page)
pages: pagesRepresentation (TabsOnTop / TabsOnBottom / None — without bookmarks), children — array page.
page: title, group (content orientation), children.
Buttons and command bars
| Key (button) | Description |
|---|---|
command |
Form command → Form.Command.Имя |
stdCommand |
Standard: "Close"; with a dot — element command: "Товары.Add" |
defaultButton: true |
Default button |
type |
usual / hyperlink |
representation |
Auto / Text / Picture / PictureAndText |
locationInCommandBar |
InCommandBar / InAdditionalSubmenu |
autoCmdBar — form command bar, main actions are placed here:
{ "autoCmdBar": "ФормаКоманднаяПанель", "children": [
{ "button": "Загрузить", "command": "Загрузить", "defaultButton": true },
{ "popup": "Печать", "title": "Печать", "children": [
{ "button": "ПечатьСчета", "command": "ПечатьСчета" } ] },
{ "buttonGroup": "ГруппаПеремещение", "children": [
{ "button": "Вверх", "command": "Вверх" },
{ "button": "Вниз", "command": "Вниз" } ] }
] }
popup— submenu:title,children.buttonGroup— buttons combined into a group:title,children.cmdBar— separate panel in the form layout:autofill,children.autoCmdBar:autofill: false— without standard commands,horizontalAlign— alignment.
Button pictures, toggle buttons, table commands in a button group, custom context menu for an element — references/buttons-commands.md.
Picture and picture field (picField)
picture: src — "StdPicture.X" / "CommonPicture.X", width, height.
picField: path; for a boolean or number — valuesPicture (otherwise the icon is not drawn). More details — references/pictures.md.
Attributes
{ "name": "Объект", "type": "DataProcessorObject.Загрузка", "main": true }
{ "name": "Итого", "type": "decimal(15,2)", "title": "Итого" }
{ "name": "Таблица", "type": "ValueTable", "columns": [
{ "name": "Номенклатура", "type": "CatalogRef.Номенклатура" },
{ "name": "Количество", "type": "decimal(10,3)" } ] }
{ "name": "Список", "type": "DynamicList", "main": true,
"settings": { "mainTable": "Catalog.Номенклатура" } }
main: true— main form attribute (object, record set, dynamic list)savedData: true— stored data (for the main object attribute it is set automatically)columns— columnsValueTable/ValueTreesettings— dynamic list settings (references/dynamic-list.md)
Saving in settings, fill check, functional options — references/attributes-advanced.md.
Commands and parameters
"commands": [ { "name": "Загрузить", "action": "ЗагрузитьОбработка", "title": "Загрузить", "shortcut": "Ctrl+Enter", "picture": "StdPicture.Refresh" } ]
"parameters": [ { "name": "Основание", "type": "DocumentRef.Заказ" } ]
Commands: name, action (handler procedure), title, shortcut, picture. Parameters: name, type, key: true — key.
Type system
| DSL | Type |
|---|---|
string / string(100) |
String (unlimited / length 100) |
decimal(15,2) / decimal(10,0,nonneg) |
Number / non-negative |
boolean |
Boolean |
date / dateTime / time |
Date / date and time / time |
CatalogRef.X / DocumentRef.X / EnumRef.X / … |
References |
CatalogObject.X / DocumentObject.X / DataProcessorObject.X / ReportObject.X |
Objects (main attribute) |
InformationRegisterRecordSet.X / AccumulationRegisterRecordSet.X |
Record sets |
ValueTable / ValueTree / ValueList |
Table / tree / value list |
DynamicList |
Dynamic list |
TypeDescription, UUID, FormattedString, Picture, Color, Font, DataCompositionSettings, StandardPeriod, mxl:SpreadsheetDocument |
Platform |
Тип1 | Тип2 |
Composite |
Also ChartOfAccountsRef/Object, ChartOfCharacteristicTypesRef/Object, ChartOfCalculationTypesRef/Object, ExchangePlanRef/Object, BusinessProcessRef/Object, TaskRef/Object, AccountingRegisterRecordSet, InformationRegisterRecordManager, ConstantsSet. Type sets — references/type-system-advanced.md.
FormDataStructure,FormDataCollection,FormDataTree— are not attribute types (error on load). Instead of them — an object type (DocumentObject.X…),ValueTable,ValueTree.
Element + attribute binding
The element displays attribute data via path.
Tabular section of the main attribute — path Объект.<ТЧ>, columns — Объект.<ТЧ>.<Реквизит>:
{ "table": "Товары", "path": "Объект.Товары", "columns": [
{ "input": "ТоварыНоменклатура", "path": "Объект.Товары.Номенклатура" },
{ "input": "ТоварыКоличество", "path": "Объект.Товары.Количество" } ] }
Table on a form attribute — attribute ValueTable with columns:
{
"elements": [
{ "table": "Данные", "path": "Данные", "changeRowSet": true, "columns": [
{ "input": "ДанныеДата", "path": "Данные.Дата" },
{ "input": "ДанныеСумма", "path": "Данные.Сумма" } ] }
],
"attributes": [
{ "name": "Данные", "type": "ValueTable", "columns": [
{ "name": "Дата", "type": "date" },
{ "name": "Сумма", "type": "decimal(15,2)" } ] }
]
}
Example: load dialog
{
"title": "Загрузка из файла",
"events": { "OnCreateAtServer": "ПриСозданииНаСервере" },
"elements": [
{ "group": "horizontal", "name": "ГруппаФайл", "children": [
{ "input": "ИмяФайла", "path": "ИмяФайла", "title": "Файл", "inputHint": "Выберите файл...",
"choiceButton": true, "events": { "StartChoice": "ИмяФайлаНачалоВыбора" } },
{ "check": "ПерваяСтрокаЗаголовок", "path": "ПерваяСтрокаЗаголовок" }
]},
{ "input": "Результат", "path": "Результат", "multiLine": true, "height": 8, "readOnly": true, "title": "Лог" },
{ "autoCmdBar": "ФормаКоманднаяПанель", "children": [
{ "button": "Загрузить", "command": "Загрузить", "defaultButton": true },
{ "button": "Закрыть", "stdCommand": "Close" }
]}
],
"attributes": [
{ "name": "Объект", "type": "ExternalDataProcessorObject.ЗагрузкаИзФайла", "main": true },
{ "name": "ИмяФайла", "type": "string" },
{ "name": "ПерваяСтрокаЗаголовок", "type": "boolean" },
{ "name": "Результат", "type": "string" }
],
"commands": [
{ "name": "Загрузить", "action": "ЗагрузитьОбработка", "shortcut": "Ctrl+Enter" }
]
}
Service nodes of elements (context menu, extended tooltip, table panels) and identifiers are created automatically. An unknown key — a warning in the output.
Task → catalog
The above is enough for most forms. For the task, load the file from references/:
| Task | Catalog |
|---|---|
| Choice list, quick choice, custom choice form, mask, number format, password, switch/toggle, open and create buttons, composite type field | input-fields.md |
| Restrict choice by filter, link a field to another field, link by type | choice-params.md |
| Collapsed group, intervals and column widths in a group, group or page header from data, bookmark icon, step-by-step wizard (pages without bookmarks) | groups-pages.md |
| Totals in the table footer, tree, multiple row selection, column pinning, search, drag and drop, remove standard table commands | table-advanced.md |
| List form: data source, query, filter, sorting, grouping, hierarchy | dynamic-list.md |
| Button with a picture, toggle in a panel, table commands in a button group, custom context menu or panel for a field, command for the current table row | buttons-commands.md |
Highlight with color, font, border, conditional formatting (in list form — dynamic-list.md) |
appearance.md |
| Extended tooltip under the field, text with highlighting or a link | tooltips-text.md |
| Picture, icon in a column, icon by value | pictures.md |
| Printed form or report on a form (spreadsheet document) | spreadsheet.md |
| HTML, text document, indicator, slider, calendar, period | special-fields.md |
| Chart, Gantt chart, scheduler | charts.md |
| Modality, size, scrolling, Enter, document form properties (time, posting) | form-properties.md |
| Report form (DCS) | report-form.md |
| Save value in settings, fill check, functional options, type of value list items | attributes-advanced.md |
| Visibility and access by roles | roles-access.md |
| Form command interface (navigations, important commands) | command-interface.md |
| Alignment, size limit, default focus, narrow screens | layout-advanced.md |
| Sets and composite types | type-system-advanced.md |
Workflow
- Framework:
/form-addcreates form metadata,Module.bsland registers the form with the object. - Compilation:
/form-compilefillsForm.xml. - Check:
/form-validate,/form-info.
External data processors (EPF)
- Main attribute:
ExternalDataProcessorObject.ИмяОбработки(notDataProcessorObject) - Data paths: form attributes (
ИмяРеквизита), and notОбъект.ИмяРеквизита— an external data processor has no object attributes in the metadata - Reference types (
CatalogRef.XXX, etc.) are allowed, but assembling an EPF requires a base with the target configuration (see/epf-build)