Status
Release Available |
Status |
Framework Name |
---|---|---|
4.1 |
Current |
Both Mui and Mint |
General
The upsert method can be used to add or edit a record.
Note
This feature works only for the List view and Card view.
To add a record, use the following configuration:
Example 202. Code JSON
{ "method": "upsert", "source": "$state(CurrencyCS);", "options": { "structureName": "currency comb11" }, "value": "$state(EditDetails);"}
Where,
-
"source": "$state(CurrencyCS);": Actor to which the new record data has to be added or updated.
-
"structureName": "currency comb11": Component structure name of the source actor.
-
"value": "$state(EditDetails);": Record data to add.
The upsert method can also be used to update an existing record using the edit operation along with adding a new record. For the Upsert crud operation to edit the records, the edit action has to be configured at the record level.
Example 203. Code JSON
{ "name": "editRecord", "actionType": "normal", "property": {}, "appearance": { "label": "edit", "style": "iconic" }, "successHandler": {}, "failureHandler": {}, "pendingHandler": {}, "handler": { "assignments": [ { "field": "$state(EditDetails);", "value": "$this;" } ], "updates": [ { "name": "$nav.overlay.add;", "value": "editRecordOverlay" } ] } }