How to see why you are getting CONSISTENCY Error

13»

Comments

  • ara3nara3n Member Posts: 9,249
    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_location}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 MAMember Posts: 3,228
    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.
Sign In or Register to comment.