Updating data is the process of changing data in a view, and sending the data back to the server. When the update is in progress the user must lock the blocks that relate to the view. This ensures that no other user can change the data between the time the program retrieves that data and the time the data is written back to the database.
The sequence of actions for an update is as follows:
Execute a report script to lock the relevant blocks and retrieve the data to be updated
Change some or all of the data in the view
Send the data back to the server and unlock the blocks
Control Flow of the Update Functions
Lock the blocks with EsxReport() or EsxBeginReport(). Make sure to set the Lock argument passed to these functions to TRUE, locking all the blocks relating to the retrieved data. These functions can either lock the blocks and retrieve the data or just lock the blocks (if the data is either new or already current). The functions lock the blocks without retrieval by changing the value of the Output argument passed to them to TRUE or FALSE, as appropriate.
Next, allow the user to edit the data cells in the view (using whatever mechanism your product provides).
Finally, call EsxUpdate() and pass it the entire contents of the view (including the updated data values), or call EsxBeginUpdate(), and send the entire view to the server a string at a time by calling EsxSendString().
Each string sent to the server must have a newline terminating each line of the update specification.
To execute an update from a file, first lock the blocks as described above and then call EsxUpdateFile().
For more detailed descriptions see EssUpdate, EssSendString, EssBeginUpdate, EsbUpdate, EsbSendString, and EsbBeginUpdate.
See API Libraries.