Adds elements, attributes, and/or commands to an existing Form.xml. Automatically allocates IDs from the correct pool, generates companion elements (ContextMenu, ExtendedTooltip, etc.) and event handlers.
Usage
/form-edit <FormPath> <JsonPath>
Parameters
| Parameter | Required | Description |
|---|---|---|
| FormPath | yes | Path to the existing Form.xml |
| JsonPath | yes | Path to the JSON with the description of additions |
Command
powershell.exe -NoProfile -File .claude/skills/form-edit/scripts/form-edit.ps1 -FormPath "<путь>" -JsonPath "<путь>"
JSON format
{
"into": "ГруппаШапка",
"after": "Контрагент",
"elements": [
{ "input": "Склад", "path": "Объект.Склад", "on": ["OnChange"] }
],
"attributes": [
{ "name": "СуммаИтого", "type": "decimal(15,2)" }
],
"commands": [
{ "name": "Рассчитать", "action": "РассчитатьОбработка" }
]
}
Positioning of elements
| Key | Default | Description |
|---|---|---|
into |
root ChildItems | Name of the group/table/page where to insert |
after |
at the end | Name of the element after which to insert |
Element types
The same DSL keys as in /form-compile:
| Key | XML tag | Companions |
|---|---|---|
input |
InputField | ContextMenu, ExtendedTooltip |
check |
CheckBoxField | ContextMenu, ExtendedTooltip |
label |
LabelDecoration | ContextMenu, ExtendedTooltip |
labelField |
LabelField | ContextMenu, ExtendedTooltip |
group |
UsualGroup | ExtendedTooltip |
table |
Table | ContextMenu, AutoCommandBar, Search*, ViewStatus* |
pages |
Pages | ExtendedTooltip |
page |
Page | ExtendedTooltip |
button |
Button | ExtendedTooltip |
Groups and tables support children/columns for nested elements.
Buttons: command and stdCommand
"command": "ИмяКоманды"→Form.Command.ИмяКоманды"stdCommand": "Close"→Form.StandardCommand.Close"stdCommand": "Товары.Add"→Form.Item.Товары.StandardCommand.Add(standard element command)
Valid events (on)
The compiler warns about errors in event names. Main ones:
- input:
OnChange,StartChoice,ChoiceProcessing,Clearing,AutoComplete,TextEditEnd - check:
OnChange - table:
OnStartEdit,OnEditEnd,OnChange,Selection,BeforeAddRow,BeforeDeleteRow,OnActivateRow - label/picture:
Click,URLProcessing - pages:
OnCurrentPageChange - button:
Click
Type system (for attributes)
string, string(100), decimal(15,2), boolean, date, dateTime, CatalogRef.XXX, DocumentObject.XXX, ValueTable, DynamicList, Type1 | Type2 (composite).
Output
=== form-edit: Форма ===
Added elements (into ГруппаШапка, after Контрагент):
+ [Input] Склад -> Объект.Склад {OnChange}
Added attributes:
+ СуммаИтого: decimal(15,2) (id=12)
---
Total: 1 element(s) (+2 companions), 1 attribute(s)
Run /form-validate to verify.
When to use
- After
/form-compile: add elements that were not in the original JSON - Modification of existing forms: add a field, attribute, or command to a form from the configuration
- Batch addition: a single JSON can contain elements + attributes + commands
Workflow
/form-info— view the current form structure- Create a JSON with the description of additions
/form-edit— add to the form/form-validate— check correctness/form-info— make sure it was added correctly