inconsistencies in the g/l entry table

ERROR MESSAGE WHEN POST PAYMENT LINE (’ the transaction cannot be completed because it will cause inconsistencies in the g/l entry table CHECK WHERE AND HOW THE CONSISTENT FUNCTION IS USED IN THE TRANSACTIION TO FIND TRHE REASON FOR THE ERROR
TABLE CAN BE MARKED AS INCONSISTENT DURING COMPREHENSIVE TASKS SUCH AS POSTING THIS PREVENTS DATA FROM BEING UPDATED INCORRECTLY)

THIS ERROR MESSAGE IN NAV CLASSIC CLIENT 2009 R2

Create a codeunit and in the codeunit add the below code.

Storetotemp variable Boolean
TempGLEntry varialble G/L entry (Makesure its set to temporary)

OnRun()
BEGIN
IF NOT StoreToTemp THEN BEGIN
StoreToTemp := TRUE;
END ELSE
PAGE.RUNMODAL(0,TempGLEntry);
END;

InsertGL(GLEntry : Record “G/L Entry”)
BEGIN
IF StoreToTemp THEN BEGIN
TempGLEntry := GLEntry;
IF NOT TempGLEntry.INSERT THEN BEGIN
TempGLEntry.DELETEALL;
TempGLEntry.INSERT;
END;
END;
END;

go to Codeunit 12 and search for below code, call the InsertGL function from codeunit 12 and right before the below code call the above codeunit and this will tell you where the error is.

GlobalGLEntry.CONSISTENT(

Hi,

this is not a usual message. Thus you might have a wrong code running on the system.

Have you or your partner made changes to the system ?

Gabor