i'm working on a integration with quickbooks online and i'm working on a process that requieres me to work on some objects. one after another and sometimes it does work but some other it doesn't and throw me this error
" You and vladimir were working on this at the same time. vladimir finished before you did, so your work was not saved."
is there a way to make to sure that that process was completed before starting another ?
Discussion posts and replies are publicly visible
Hi felixr
Is the integration you want to put a lock on or the complete process itself? By lock I mean only one user can access it at a time.
If it is the process there are multiple ways you can do it, one of which is marking the status of the process to active and storing that either in database or in cache using (Text cache Plugin), at the start of the process you set it to 'active' and once the process is complete at the end you can set it to 'inactive'.
At the very start, you can check the status of the process by fetching the status if it is 'inactive' proceed further, else you can provide user with a friendly interface giving information about the active process and who is using it, and skipping the complete flow.
Hope this helps
is the complete process itself cause i first have to create an invoice then i obtain the id of the new invoice and i Llnk it to an existing estimate and then i grab a sync token from that estimate and i link it to the created invoice i have to make some calls to the integration and it seems like this errors is thrown when i haven't obtained the new token yet but it doesn't occurs always but sometimes
In this case, you can put the lock on the process model if it is active, using the method described in the above comment.
and if it is the token causing the error you can put a retry mechanism in case a new token is not generated.
Hope it helps