Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Events sometimes cause a COMMIT when throwing an ERROR !

$
0
0
I have made a simple change in NAV2017 CU7, to ensure certain fields are filled before the document can be approved. I therefore simply made a new Subscriber function listening to “Approvals Mgmt.”.OnApproveApprovalRequest(). My function then do the custom validation and gives an ERROR if something is missing.

I know this means the event has two subscribers, and that I cannot be sure that my custom code is executed before the standard subscriber code updating the Approval Entries. It is not performance critical, so I can accept that.

However, once in a while we get the error from my subscriber function, BUT the Approval Entry is updated and COMMIT’ed !!!

First thought was, that the standard subscriber function contained a COMMIT. I tried finding it using this method: https://dynamicsuser.net/nav/b/reijer/posts/aaargh-where-is-that-commit and placing a CONSISTENT(FALSE) in the standard subscriber function. But the only COMMIT, is the automatic COMMIT after both subscriber functions are executed.
Again, even with the unconditional CONSISTENT(FALSE) in the subscriber, suddenly the Approval Entry was approved! It happens very rarely, but it does happen once in a while.

Has anyone seen anything like it, or has any idea what the problem can be?

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>