Discussions
Scheduled Script concurrency control?
Hello!
Can optimistic locking be achieved when reading and later updating transactions lines?
Business Requirement:
Based on sales order lines creation/updates many custom record lines needs to be updated.
Planed solutions design:
A Scheduled Script will:
1, search (nlapiSearchRecord) all new or updated sales order lines
2, loop and load (nlapiLoadRecord) sales order records
3, based on every sales order line, 1-200 custom records needs to be updated.
4, nlapiSubmitRecord custom records
5, set custcol on sales order lines that the lines are handled by this script.
6, nlapiSubmitRecord sales order
Problem
A user might update sales order/lines between steep 2 and steep 6. This sequence of updated should be handled as one database transaction or with proper optimistic concurrency control.