Платформа 3V/Формы/Действия/Удаление элемента справочника

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

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

1  {
2       "dictionaryId": 1,
3       "expressionId": 1,
4       "id": 1,
5       "comment": "Удаление элемента справочника",
6       "discriminator": "RemoveDictionaryElementsAction"
7     }

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

Свойство Описание
dictionaryId Идентификатор справочника
expressionId Идентификатор выражения
id Идентификатор действия
comment Описание действия
discriminator RemoveDictionaryElementsAction

Пример использования

Кейс: Удалить элемент из справочника.

Добавить действие, в котором указать идентификатор выражения. Удаление происходит при нажатии кнопки. Пример формы: https://study.3v-cloud.com/navigator/#/home?objectId=210

Удаление элемента.gif













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