Atomic operations for modifying an existing data composition schema: adding, removing, and modifying fields, totals, filters, parameters, variant settings, managing structure, replacing the query.
Parameters and command
| Parameter | Description |
|---|---|
TemplatePath |
Path to Template.xml (or to the folder — auto-completion Ext/Template.xml) |
Operation |
Operation (see the list below) |
Value |
Operation value (shorthand string or query text) |
DataSet |
(optional) Data set name (default: the first one) |
Variant |
(optional) Settings variant name (default: the first one) |
NoSelection |
(optional) Do not add the field to the variant selection |
powershell.exe -NoProfile -File .claude/skills/skd-edit/scripts/skd-edit.ps1 -TemplatePath "<path>" -Operation <op> -Value "<value>"
Batch mode (batch)
Multiple values in a single call separated by ;;:
-Operation add-field -Value "Цена: decimal(15,2) ;; Количество: decimal(15,3) ;; Сумма: decimal(15,2)"
Works for all operations except set-query, set-structure и add-dataSet.
Operations
add-field — add a field to the data set
Shorthand: "Имя [Заголовок]: тип @роль #ограничение".
"Цена: decimal(15,2)"
"Организация [Орг-ция]: CatalogRef.Организации @dimension"
"Служебное: string #noFilter #noOrder"
The field is added to the set and to the variant selection (if there is no -NoSelection). Duplicate dataPath — warning, skipped.
add-total — add a total
"Цена: Среднее"
"Стоимость: Сумма(Кол * Цена)"
add-calculated-field — add a calculated field
Shorthand: "Имя [Заголовок]: тип = Выражение".
"Маржа = Продажа - Закупка"
"Наценка [Наценка, %]: decimal(10,2) = Маржа / Закупка * 100"
It is also added to the variant selection.
add-parameter — add a parameter
"Период: StandardPeriod = LastMonth @autoDates"
"Организация: CatalogRef.Организации"
@autoDates generates ДатаНачала и ДатаОкончания automatically.
add-filter — add a filter to the variant
Shorthand: "Поле оператор значение @флаги". Flags: @off, @user, @quickAccess, @normal, @inaccessible.
"Номенклатура = _ @off @user"
"Дата >= 2024-01-01T00:00:00"
"Статус filled"
add-dataParameter — add a data parameter to the variant
Shorthand: "Имя [= значение] @флаги".
"Период = LastMonth @user"
"Организация @off @user"
add-order — add sorting
Shorthand: "Поле [desc]". By default asc. Auto — auto item.
"Количество desc"
"Auto"
add-selection — add a selection item
"Номенклатура"
"Auto"
add-dataSetLink — add a data set link
Shorthand: "Источник > Приёмник on ВырИсточника = ВырПриёмника [param Имя]".
"Набор1 > Набор2 on Поле1 = Поле2"
"Набор1 > Набор2 on Поле1 = Поле2 [param Связь]"
add-dataSet — add a data set
Shorthand: "Имя: ТЕКСТ_ЗАПРОСА" or "ТЕКСТ_ЗАПРОСА" (auto name НаборДанныхN).
"Доп: ВЫБРАТЬ 1 КАК Тест"
"ВЫБРАТЬ Ссылка ИЗ Справочник.Номенклатура"
dataSource is taken from the first existing one. Duplicate name — warning, skipped. Does not support batch mode (the query may contain ;;).
add-variant — add a settings variant
Shorthand: "Имя [Представление]". The representation is optional, defaults to = name.
"Детальный"
"Детальный [Детальный отчёт]"
Creates a variant with Auto selection + detail group. Duplicate name — warning, skipped.
add-conditionalAppearance — add conditional appearance
Shorthand: "Параметр = значение [when условие] [for Поле1, Поле2]". Block when — syntax add-filter (Field operator value).
"ЦветТекста = web:Red when Сумма < 0"
"ЦветФона = web:LightGreen when Статус = Одобрен for Статус"
"МинимальнаяШирина = 50 for Организация"
"Формат = ЧДЦ=2 for Цена, Сумма"
Value types (auto-detect): web:*/style:*/win:* → color, true/false → boolean, otherwise string.
set-query — replace the query text
Does not support batch mode. Value — the full query text.
set-outputParameter — set an output parameter
"Заголовок = Мой отчёт"
"ВыводитьЗаголовок = true"
If the parameter already exists — replaces the value.
set-structure — set the variant structure
Shorthand: "Поле1 > Поле2 > details". details/детали — detail records. Replaces the entire structure. Does not support batch mode.
"Организация > Номенклатура > details"
"details"
modify-field — modify an existing field
The same shorthand as add-field. Finds by dataPath, merges properties (non-empty ones override), preserves position.
"Цена [Цена USD]: decimal(10,4) @dimension"
modify-filter — modify an existing filter
The same shorthand as add-filter. Finds by field, updates operator/value/flags.
modify-dataParameter — modify a data parameter
The same shorthand as add-dataParameter. Finds by name, updates value/flags.
remove-* и clear-*
| Operation | Value | Action |
|---|---|---|
remove-field |
dataPath | Removes the field from the set + from the variant selection |
remove-total |
dataPath | Removes the total |
remove-calculated-field |
dataPath | Removes the calculated field + from selection |
remove-parameter |
name | Removes the parameter |
remove-filter |
field | Removes the first filter with the specified field |
clear-selection |
* |
Clears all selection elements |
clear-order |
* |
Clears all order elements |
clear-filter |
* |
Clears all filter elements |
Verification
/skd-validate <TemplatePath> — валидация структуры после редактирования
/skd-info <TemplatePath> — визуальная сводка