Платформа 3V/Формы/Действия/Сохранение источников

Материал из 3v-wiki
Перейти к навигации Перейти к поиску

Действие, которое сохраняет добавленный элемент в источнике данных, имеет следующую структуру:

1 {
2       "dataSourcesIds": [
3         1,
4         2
5       ],
6       "id": 1,
7       "comment": "Сохранение источников",
8       "discriminator": "SaveDataSourceAction"
9 }

Описание свойств действия

Свойство Описание
dataSourcesIds Идентификаторы источников данных
id Идентификатор действия
comment Описание действия
discriminator SaveDataSourceAction

Пример использования(сохранение в справочнике)

Кейс: Сохранить изменения в справочнике.

Добавить действие, где указать источник данных, в котором требуется сохранять изменения. Сохранение происходит при нажатии кнопки.

Сохранение справочника.gif











JSON серверной карточки
  1 {
  2   "id": 78,
  3   "name": "SaveDataSourceAction",
  4   "description": "",
  5   "title": "",
  6   "entrySettings": null,
  7   "uiSources": [
  8     {
  9       "dataSourceId": 111,
 10       "nameTemplate": "",
 11       "displayAttribute": null,
 12       "hasMultipleValue": false,
 13       "hasNullableValue": false,
 14       "maxElements": null,
 15       "hasServerFiltration": false,
 16       "searchSettings": {
 17         "maxElements": null,
 18         "minInputChars": 2,
 19         "searchMode": "Client",
 20         "debounceMs": 300
 21       },
 22       "id": 111,
 23       "caption": null,
 24       "enable": true,
 25       "visible": true,
 26       "hint": null,
 27       "uiDataSource": null,
 28       "doActionOnChangeValue": true,
 29       "onAfterChangeValueConditionalActions": null,
 30       "onAfterChangeValueByClientConditionalActions": null,
 31       "rebuildDependentsObjectOnChange": true,
 32       "enableRuleIds": [],
 33       "visibleRuleIds": [],
 34       "access": null,
 35       "isValueChanged": true,
 36       "expressionId": null,
 37       "discriminator": "DictionarySourceEntry"
 38     },
 39     {
 40       "submitRuleIds": [],
 41       "actionConfirmation": {
 42         "message": null,
 43         "conditionId": null
 44       },
 45       "controlsValueCalculateRulesIds": [],
 46       "conditionalActions": [
 47         111
 48       ],
 49       "onBeforeClickConditionalActions": [],
 50       "id": 112,
 51       "caption": "Сохранить",
 52       "enable": true,
 53       "visible": true,
 54       "hint": null,
 55       "uiDataSource": null,
 56       "doActionOnChangeValue": false,
 57       "onAfterChangeValueConditionalActions": null,
 58       "onAfterChangeValueByClientConditionalActions": null,
 59       "enableRuleIds": [],
 60       "visibleRuleIds": [],
 61       "access": {
 62         "read": {
 63           "roles": [],
 64           "inversion": false,
 65           "default": true
 66         },
 67         "edit": {
 68           "roles": [],
 69           "inversion": false,
 70           "default": true
 71         }
 72       },
 73       "isValueChanged": false,
 74       "expressionId": null,
 75       "discriminator": "CustomButtonEntry"
 76     },
 77     {
 78       "pivotSourceId": 222,
 79       "doActionOnChangeFocusedCell": true,
 80       "doActionOnChangeCellValue": false,
 81       "id": 222,
 82       "caption": null,
 83       "enable": false,
 84       "visible": true,
 85       "hint": null,
 86       "uiDataSource": null,
 87       "doActionOnChangeValue": false,
 88       "onAfterChangeValueConditionalActions": null,
 89       "onAfterChangeValueByClientConditionalActions": null,
 90       "rebuildDependentsObjectOnChange": true,
 91       "enableRuleIds": [],
 92       "visibleRuleIds": [],
 93       "access": null,
 94       "isValueChanged": false,
 95       "expressionId": null,
 96       "discriminator": "PivotSourceEntry"
 97     },
 98     {
 99       "defaultValue": null,
100       "value": null,
101       "id": 21,
102       "caption": "Номер договора",
103       "enable": true,
104       "visible": true,
105       "hint": null,
106       "uiDataSource": {
107         "attributeId": 21,
108         "sourceId": 111,
109         "discriminator": "UiDataSourceDictionary"
110       },
111       "doActionOnChangeValue": false,
112       "discriminator": "StringSourceEntry"
113     },
114     {
115       "defaultValue": null,
116       "value": null,
117       "id": 22,
118       "caption": "Дата заключения",
119       "enable": true,
120       "visible": true,
121       "hint": null,
122       "uiDataSource": {
123         "attributeId": 22,
124         "sourceId": 111,
125         "discriminator": "UiDataSourceDictionary"
126       },
127       "doActionOnChangeValue": false,
128       "discriminator": "StringSourceEntry"
129     }
130   ],
131   "entryDataSources": [
132     {
133       "dictionaryId": 80,
134       "hierarchyId": null,
135       "filter": null,
136       "sortingOptions": null,
137       "groupingOptions": null,
138       "dictionaryAttributes": null,
139       "defaultValue": [],
140       "defaultValueExpressionId": null,
141       "parameterId": null,
142       "dictionarySourceSelectionMode": "None",
143       "dataSourceAttributesAdditionsSettings": [],
144       "externalFileStorageUrl": null,
145       "filePrefix": null,
146       "defaultNewElementSettings": null,
147       "id": 111,
148       "name": null,
149       "isReadOnly": false,
150       "dataEditRuleIds": [],
151       "beforeSaveDataActions": [],
152       "afterSaveDataActions": [],
153       "discriminator": "DictionaryDataSource"
154     },
155     {
156       "pivotId": 81,
157       "parameters": [],
158       "focusOnFirstCell": true,
159       "doActionOnChangeFocusedCell": true,
160       "doActionOnChangeCellValue": true,
161       "id": 222,
162       "name": null,
163       "isReadOnly": false,
164       "dataEditRuleIds": [],
165       "beforeSaveDataActions": [],
166       "afterSaveDataActions": [],
167       "discriminator": "PivotDataSource"
168     }
169   ],
170   "parameters": [],
171   "binaryConditionsRules": [],
172   "submitValidateRules": [],
173   "expressions": [],
174   "controlsValueCalculateRules": [],
175   "actions": [
176     {
177       "dataSourcesIds": [
178         111
179       ],
180       "id": 111,
181       "comment": "Сохранение значения",
182       "discriminator": "SaveDataSourceAction"
183     },
184     {
185       "dataSourcesIds": [
186         222
187       ],
188       "id": 222,
189       "comment": "Сохранение значения",
190       "discriminator": "SaveDataSourceAction"
191     }
192   ],
193   "conditionActionIdsOnOpen": [],
194   "conditionalActions": [
195     {
196       "id": 111,
197       "binaryConditionRuleId": null,
198       "actions": [
199         111
200       ],
201       "parallelRunning": true
202     },
203     {
204       "id": 222,
205       "binaryConditionRuleId": null,
206       "actions": [
207         222
208       ],
209       "parallelRunning": true
210     }
211   ],
212   "selectionSets": [],
213   "reportTemplates": [],
214   "useNewDependenciesBuilder": null
215 }