Ledger Entry Dimension Already Exists Error

lloydsmodslloydsmods Member Posts: 93
I've run into this error with a client trying to post a payment journal. The Ledger Entry Dimension already exists. Table ID = 17, Entry No=377261, Dimension Code='COST CENTER'.

There are 123 lines in the payment batch. Since the last G/L Entry is 377220 it looks to me like it's duplicating a Ledger Entry Dimension that is created earlier in the posting. When i debug, it craps out in CU 13 on COMMIT, 13 lines from the bottom of the Code() trigger. The record that is assigned to all the GenJnlLine variables is the last record in the batch.

Any suggestions how to find the problem or where to start looking next would be appreciated.
If guns cause crime mine must be defective.

Comments

  • stanpstanp Member, Microsoft Employee Posts: 13
    This looks like the system error message during INSERT. If you run debugger it should stop at a line with LedgEntryDim.INSERT, not COMMIT. That is strange.

    There is a brilliant trick to see what was going on during failed transaction described here
    http://www.mibuso.com/forum/viewtopic.php?t=22748
    and here
    http://gotcal.com/index.php/2010/10/what-is-in-your-dynamics-nav-toolbelt-find-inconsistency-in-gl-entries-when-posting/

    Try to play with it.
    Good luck
    Stan Pesotskiy
    Senior SDE - Dynamics Nav Application - Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • lloydsmodslloydsmods Member Posts: 93
    I found the problem. Another developer modified CU 12 to write a Ledger Entry Dimension for certain transactions. Then when CU 408 did the same thing later, the error occurred. I just added a line of code to the trigger in CU 408 to check for an existing entry before inserting.

    Thanks to Stan for posting a suggestion.
    If guns cause crime mine must be defective.
  • kinekine Member Posts: 12,562
    Just want to add: you got the error on commit because the delayed bulked inserts. The inserts are done into DB only when transaction ends or you read same table. It means, that .insert itself will not write the record, it will only queue it until really needed. It is optimization in the client.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Big_DBig_D Member Posts: 207
    Hi Kine

    Thanks for the explanation - this answers a lot but this functionality makes debugging and tracing the error a nightmare as unsure when the insert statement was actually executed. Navision didn't use to work this way - is there a way to switch it off when debugging or is this a SQL option!

    With thanks
    Big D signing off!
  • kinekine Member Posts: 12,562
    This is NAV feature and Ido not know any "switch" to disable it. True is, that because this the performance is better in many areas.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Big_DBig_D Member Posts: 207
    Hi Kine

    Thanks for the explanation - Guess its gonna keep me in a job for years to come ](*,) !

    At least they fixed this issue in terms of batch jobs in R2 \:D/ !

    With thanks
    Big D signing off!
Sign In or Register to comment.