Платформа 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

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

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

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

Сохранение справочника2.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         222
 49       ],
 50       "onBeforeClickConditionalActions": [],
 51       "id": 112,
 52       "caption": "Сохранить",
 53       "enable": true,
 54       "visible": true,
 55       "hint": null,
 56       "uiDataSource": null,
 57       "doActionOnChangeValue": false,
 58       "onAfterChangeValueConditionalActions": null,
 59       "onAfterChangeValueByClientConditionalActions": null,
 60       "enableRuleIds": [],
 61       "visibleRuleIds": [],
 62       "access": {
 63         "read": {
 64           "roles": [],
 65           "inversion": false,
 66           "default": true
 67         },
 68         "edit": {
 69           "roles": [],
 70           "inversion": false,
 71           "default": true
 72         }
 73       },
 74       "isValueChanged": false,
 75       "expressionId": null,
 76       "discriminator": "CustomButtonEntry"
 77     },
 78     {
 79       "pivotSourceId": 222,
 80       "doActionOnChangeFocusedCell": true,
 81       "doActionOnChangeCellValue": false,
 82       "id": 222,
 83       "caption": null,
 84       "enable": false,
 85       "visible": true,
 86       "hint": null,
 87       "uiDataSource": null,
 88       "doActionOnChangeValue": false,
 89       "onAfterChangeValueConditionalActions": null,
 90       "onAfterChangeValueByClientConditionalActions": null,
 91       "rebuildDependentsObjectOnChange": true,
 92       "enableRuleIds": [],
 93       "visibleRuleIds": [],
 94       "access": null,
 95       "isValueChanged": false,
 96       "expressionId": null,
 97       "discriminator": "PivotSourceEntry"
 98     },
 99     {
100       "defaultValue": null,
101       "value": null,
102       "id": 2,
103       "caption": "Наименование",
104       "enable": true,
105       "visible": true,
106       "hint": null,
107       "uiDataSource": {
108         "attributeId": 2,
109         "sourceId": 111,
110         "discriminator": "UiDataSourceDictionary"
111       },
112       "doActionOnChangeValue": false,
113       "discriminator": "StringSourceEntry"
114     },
115     {
116       "defaultValue": null,
117       "value": null,
118       "id": 21,
119       "caption": "Номер договора",
120       "enable": true,
121       "visible": true,
122       "hint": null,
123       "uiDataSource": {
124         "attributeId": 21,
125         "sourceId": 111,
126         "discriminator": "UiDataSourceDictionary"
127       },
128       "doActionOnChangeValue": false,
129       "discriminator": "StringSourceEntry"
130     },
131     {
132       "defaultValue": null,
133       "value": null,
134       "id": 22,
135       "caption": "Дата заключения",
136       "enable": true,
137       "visible": true,
138       "hint": null,
139       "uiDataSource": {
140         "attributeId": 22,
141         "sourceId": 111,
142         "discriminator": "UiDataSourceDictionary"
143       },
144       "doActionOnChangeValue": false,
145       "discriminator": "StringSourceEntry"
146     }
147   ],
148   "entryDataSources": [
149     {
150       "dictionaryId": 80,
151       "hierarchyId": null,
152       "filter": null,
153       "sortingOptions": null,
154       "groupingOptions": null,
155       "dictionaryAttributes": null,
156       "defaultValue": [],
157       "defaultValueExpressionId": null,
158       "parameterId": null,
159       "dictionarySourceSelectionMode": "None",
160       "dataSourceAttributesAdditionsSettings": [],
161       "externalFileStorageUrl": null,
162       "filePrefix": null,
163       "defaultNewElementSettings": null,
164       "id": 111,
165       "name": null,
166       "isReadOnly": false,
167       "dataEditRuleIds": [],
168       "beforeSaveDataActions": [],
169       "afterSaveDataActions": [],
170       "discriminator": "DictionaryDataSource"
171     },
172     {
173       "pivotId": 81,
174       "parameters": [],
175       "focusOnFirstCell": true,
176       "doActionOnChangeFocusedCell": true,
177       "doActionOnChangeCellValue": true,
178       "id": 222,
179       "name": null,
180       "isReadOnly": false,
181       "dataEditRuleIds": [],
182       "beforeSaveDataActions": [],
183       "afterSaveDataActions": [],
184       "discriminator": "PivotDataSource"
185     }
186   ],
187   "parameters": [],
188   "binaryConditionsRules": [],
189   "submitValidateRules": [],
190   "expressions": [],
191   "controlsValueCalculateRules": [],
192   "actions": [
193     {
194       "dataSourcesIds": [
195         111
196       ],
197       "id": 111,
198       "comment": "Сохранение значения",
199       "discriminator": "SaveDataSourceAction"
200     },
201     {
202       "instanceId": 222,
203       "id": 222,
204       "comment": "Ребилд пивота",
205       "discriminator": "RebuildSourceInstanceAction"
206     }
207   ],
208   "conditionActionIdsOnOpen": [],
209   "conditionalActions": [
210     {
211       "id": 111,
212       "binaryConditionRuleId": null,
213       "actions": [
214         111
215       ],
216       "parallelRunning": true
217     },
218     {
219       "id": 222,
220       "binaryConditionRuleId": null,
221       "actions": [
222         222
223       ],
224       "parallelRunning": false
225     }
226   ],
227   "selectionSets": [],
228   "reportTemplates": [],
229   "useNewDependenciesBuilder": null
230 }