Dear reader,
We have to following problem:
when we do a stock conversion this does the following:
first negative adjustment (commit)
then check if there is no other costs booked on the stock (commit)
make positive adjustment with the total costs (commit)
These are three different processes.
Sometimes, when the positive adjustment is done there is a 'locked by another user' and this part is undone. The situation then is, that the negative adjustment is done, the check as well, but the positive is not. In short: The piece has disappeared.
Is it possible to make one transaction which undoes everything when an error occurs in the second or third part?
Kind regards,
Adri
0
Answers
As I got your question, you have 2 options here:
1. Get rid of intermediate commits and make the big one in the end;
2. Manually (in the code) roll back previous commited transactions (creating corrective entries) in the case of error.
Hope my suggestions are useful for you. If not, we can discuss your issue to find more appropeiate way.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
I hope it was possible to have to following construction:
DO TRANSACTION
process 1 (which processes and commits)
process 2 (which processes and commits)
process 3 (which processes and commits)
END TRANSACTION
And when something goes wrong in one of the three commits it would roll back all.
Only one thing I can advice you is to copy standard functionality to new objects in available range fpr development, and replace calls in the system. But be aware that it's bad practise.
@Logger: There are programming languages who only commit when the transaction is finished. You can assign/commit anything at any time, but it is writen to the database then the transaction has finished. With for example "progress" (also a 4GL language) you can do as described above.
In "Progress" the commit 'writes' the database changes, but when something is wrong everything is rolled back. I hoped in C/AL this was possible as well.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03