I am designing an application that will create nav documents. I have noticed that after an INSERT command if an error occurs the inserted record remains... this is dangerous as the users of the application may post a redundant document. I need an application that will determine whether a transaction has been successful and that there has been no error only then will it create a Document, otherwise it has to abort the whole transaction. How do i structure my application to achieve this?
0
Comments
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
NAV uses implicit transactions. That is you don't need to explicitly begin a transaction. The transaction ends (is committed) when either callign function ends, or an explicit COMMIT command is called. A transaction begins when a database write occurs (insert, modify, delete). In the case of a FINDSET(TRUE) the transaction begins with the select.
In the event of an error, NAV will rollback the current active transaction. So the question becomes, is there prior commits beign executed?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
NAV also issues a COMMIT if you use the returnvalue from a CODEUNIT.RUN or REPORT.RUN.
Typically in an IF CODEUNIT.RUN("My Codeunit",MyRecord) THEN... structure.
Peter