i have got that error in posting preview and i found that in codeunit transaction-post previewmode was true but when it's posting codeunit gen. jnl. post, previewmode is not passed true. Before posting gen. jnl. post in transaction-post you have to setpreviewmode true and then everything is fixed.
I was getting the error saying: "where and how the CONSISTENT function is used in the transaction to find the reason for the error.\\Contact your system administrator.\\Tables can"
It happened whenever I would run my test from Test Toolkit. What I did was to go to my test function and above it added: [TransactionModel(TransactionModel::AutoRollback)]
The error stopped coming.
The entire function signature now looks like this:
[Test]
// Below should always be set else you'll get GLEntry consistency errors
[TransactionModel(TransactionModel::AutoRollback)]
procedure postInvoice_NotRegistered()
I was getting the error saying: "where and how the CONSISTENT function is used in the transaction to find the reason for the error.\\Contact your system administrator.\\Tables can"
It happened whenever I would run my test from Test Toolkit. What I did was to go to my test function and above it added: [TransactionModel(TransactionModel::AutoRollback)]
The error stopped coming.
The entire function signature now looks like this:
[Test]
// Below should always be set else you'll get GLEntry consistency errors
[TransactionModel(TransactionModel::AutoRollback)]
procedure postInvoice_NotRegistered()
The CONSISTENT error is tripped by the commit to the database. With the AutoRollBack setting the commit never happens. Thus no error. Same reason a test post won't trip this error.
Comments
https://dynamicsuser.net/nav/b/ara3n/posts/consistency-error-in-dynamics-nav
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
edit: for nav 18
It happened whenever I would run my test from Test Toolkit. What I did was to go to my test function and above it added: [TransactionModel(TransactionModel::AutoRollback)]
The error stopped coming.
The entire function signature now looks like this:
[Test]
// Below should always be set else you'll get GLEntry consistency errors
[TransactionModel(TransactionModel::AutoRollback)]
procedure postInvoice_NotRegistered()
The CONSISTENT error is tripped by the commit to the database. With the AutoRollBack setting the commit never happens. Thus no error. Same reason a test post won't trip this error.
Hi ara3n
This link is broken, can you help me with to look into this solution? I'm trying to implement it in Business Central.
Thanks a lot!
https://bcrepositories.com/2024/08/09/Check-GL-Inconsistencies/
Rgds.
D365 Business Central Solutions Architect
BC AL/NAV C/AL Developer
BC Repositories.com