Hi All,
I'm writing an extension that wants to do some changes to SalesLines just before posting a Sales Order.
For this purpose I subscribe to the OnBeforePostSalesDoc event in codeunit 80.
When the posting does not succeed, due to an error that is thrown in Microsofts part of the code, I want to undo my changes!
How to achieve this, is my question.
I've been looking for an event, like "OnPostingError", or something like it, but I have not found anything of the sort in either codeunit 80, 825 or table 55.
I also tried setting the "IsCommitSuppressed" parameter of the OnBeforePostSalesDoc to true, but it seems to be readonly (no "var" in front of it).
My hope was to extend the transaction to include my changes so that everything as a whole would be rolled back in case of error.
Microsoft does not seem to allow that.
So if both approaches are wrong, how does one undo ones changes in case of an error thrown in Microsofts part of the code...?
Any suggestions are appreciated.
Best regards,
Wolter Kaper
Entocare CV