Save to database (conflict-aware) - save data from a section to a list or data table.
A given action prevents data that may have been modified by other sources from being overwritten in the time between downloading it and attempting to save it. This ensures that the user does not make changes that may conflict with other modifications made in the meantime.
This action ensures data integrity by blocking data from being saved if conflicts are detected. This means that data will not be saved if conflicts occur.
Action step: save to database (conflict-aware)
Where you can use action:
Workflow
Parameters:
Section: (type text) - section name
List/table: (type: text) - the name of the list or table into which the date will be saved
Error message: (optional parameter) - the message that will be displayed to the user in case of conflict
Principles of action:
- Saving of data to a list or table takes place only if there are no conflicts
- The action check whether the data has been modified by other sources before writing. Data modification can occur as a result of:
- previous saving of data by the application
- changes made by the application
- changes made by the user through GridView
- import of data from an external source
- changes made by API
- Lookup: Before updating existing rows, the data must first be downloaded to te section in the filter using lookup (you cannot simply type key values into cells).
- In the event of a conflict in the data, the action does not save any rows. Even if only a few rows generate a conflict, the entire save action is cancelled, which protects the integrity of the data.
There are two types of conflict that cat occur when attempting to save:
- Overwriting a modified record: This conflict occurs whan we try to update an existing record that has been downloaded to a section (by lookup), but has already been modified by another user before the save attempt.
- Saving a new record that already exists: This type of conflict occurs when we try to add a new record that has in the meantime already been created by another user.
Example:
Suppose an application is user to manage customer orders and includes functionality to update the status of orders in the table "TAB_SALES".
The data is downloaded into the 'ORDER' section.
Section "ORDER"
Action step: "Save to database (conflict-aware)"
Action process:
- The user downloads the order data to the "ORDER" section through lookup.
- In the course of the user's work, the date may have been modified by another source (e.g. by the API or another user has changed the order satus in the GridView).
- When finished, the user tries to save the changes.
- The application checks that the data in the "ORDERS" section has not been modified since it was downloaded.
- If the data has been modified (e.g. change of order status from "Accepted" to "In realisation" by another user, the save operation is aborted and the user receives the message: "Your order data has been modified by another user. Please rebind the data and try again"
- If the data have not been modified, the save operation is executed and all rows in the table "TAB_SALES" are updated.
Data was overwritten by a previous user (error message)
The data have been correctly entered into the table
0 Comments