INCONSISTENCY Error in Navision Occur because of the following reason.
Posting invoices writes to the G/L entries and the total must ALWAYS be 0.
Somewhere an amount is written but it has no opposite to make the total 0.
This means that there is a problem with some customization of the code.
This is a trick I use whenever I do try to solve and see why you the db is getting CONSISTENT Error.
I create the following CU.
OBJECT Codeunit 50000 Single Instance CU
Time=[ 2:50:02 PM];
IF NOT StoreToTemp THEN BEGIN
StoreToTemp := TRUE;
[email protected] : TEMPORARY Record 17;
[email protected] : Boolean;
PROCEDURE [email protected]([email protected] : Record 17);
IF StoreToTemp THEN BEGIN
TempGLEntry := GLEntry;
IF NOT TempGLEntry.INSERT THEN BEGIN
And in CU 12 I add the following Code in function FinishCodeunit
WITH GenJnlLine DO BEGIN
IF GLEntryTmp.FIND('-') THEN BEGIN
GLEntry := GLEntryTmp;
IF GLSetup."Additional Reporting Currency" = '' THEN BEGIN
GLEntry."Additional-Currency Amount" := 0;
GLEntry."Add.-Currency Debit Amount" := 0;
GLEntry."Add.-Currency Credit Amount" := 0;
IF NOT InsertFAAllocDim(GLEntry."Entry No.") THEN
Once you've made the changes. You run the SinleInstanceCU Once.
Then do what ever you do to get the consistency error.
Then Run the SingleInstanceCU again.
You'll see a list of GL lines. You will see why the transaction is not balanced.