How to see why you are getting CONSISTENCY Error

13»

Comments

  • ara3nara3n Member Posts: 9,256
    edited 2017-10-23
    I've updated this for 2016 that uses events. So no objects are modified.

    https://dynamicsuser.net/nav/b/ara3n/posts/consistency-error-in-dynamics-nav


    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • gozgokgozgok Member Posts: 1
    edited 2018-11-30
    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.

    edit: for nav 18
  • rsgilbertrsgilbert Member Posts: 3
    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()
  • bbrownbbrown Member Posts: 3,268
    rsgilbert wrote: »
    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.

    There are no bugs - only undocumented features.
  • rafaerurafaeru Member Posts: 5
    ara3n wrote: »
    I've updated this for 2016 that uses events. So no objects are modified.

    https://dynamicsuser.net/nav/b/ara3n/posts/consistency-error-in-dynamics-nav


    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!
  • markborgesmarkborges Member Posts: 170
    Hi rafaeru, I've recently wrote a solution for BC 24, that uses pretty much the same concept as ara3n original idea, but applied to BC events.

    https://bcrepositories.com/2024/08/09/Check-GL-Inconsistencies/

    Rgds.
    Marcelo Borges
    D365 Business Central Solutions Architect
    BC AL/NAV C/AL Developer
    BC Repositories.com
Sign In or Register to comment.