CONSISTENT function error

SupSup Member Posts: 11
Hi,
I get the following error:

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 transaction to find the reason of the error. Contact your system manager if you need assistance. Parts of the program mark tables as inconsistent during very comprehensive tasks, such as posting. This prevents data from being updated incorrectly.

I have modified the code in CodeUnit 80. I basically modify the tax value and the amount including vat value in TempSalesTaxAmtLine record.

I dont get this error when I comment my code. So I am sure that my code has introduced this error in the system.

What am I doing wrong?

Thanks & Regards,
Sup

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    I hope you are an experienced Navision developer. Changing tax values and amounts in codeunit 80 is not recommended because it could lead to ... inconsistency errors. #-o
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • SupSup Member Posts: 11
    Hi,
    I do need to change the values. There is no other option to it.
    Can you tell me what I could do to not get this error?

    Thanks & Regards,
    Sup
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You are getting this error because the total of the Debit amounts is not equal to the total of the Credit amounts anymore in the G/L Entries.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • bbrownbbrown Member Posts: 3,268
    Look at the function "Finishcodeunit" (I may not have the exact name). This function check if the posting to G/L is inbalance (Debits = Credits) before committing the changes. If not inbalance it returns the error you are getting.

    Try the following:

    1. Set a breakpoint in the above function.

    2. Turn on debugger and post you order.

    3. Step through the function and write down the G/L accounts and amounts.

    You should be able to identify the out-of-balance account. Since you mention that you are changing tax amounts in CU80, I would guess that you are not also changing the balance account.
    There are no bugs - only undocumented features.
  • jpjesusjpjesus Member Posts: 45
    I have run into problems with this in the past. And it was with the standard Navision codeunits, at least the portuguese version.

    My suggestion if for you to check how you are rounding the values in your code. Parcial rounding against total rounding can easily produce this error in codeunit 12 when posting.
  • nelsonnelson Member Posts: 107
    Yes, we can sometimes get this error in a completely standard PT database. The localization introduces this possibility. :roll:
    Nelson Alberto
  • SupSup Member Posts: 11
    Hi,
    Thanks for all the help. I got rid of the error. My debits and credits did not match coz of the code that I added.
    Now it works fine.

    Thanks & Regards,
    Sup
Sign In or Register to comment.