The G/L Entry already exists error.

jversusj
Member Posts: 489
hello all. i searched the forum for this error and while i found a lot of similar errors, nothing directly relating to this, nor how to resolve.
I have a single Purchase Order that will not Post Invoice. The receipt was already posted, and now A/P is trying to invoice the receipt.
When you attempt to invoice (or receive and invoice), you get an error:
If you attempt to post again, you get the same error, alhtough the entry no. changes. We have a lot of mods in our system, but nothing was recently changed in the posting objects and this only seems to be impacting this one purchase order. any ideas on where i can start looking?
I ran with debugger active (no breakpoints) and found that it is stopping in Codeunit 12 Gen. Jnl.-Post Line\FinishCodeunit() at this point:
Initially, i was able to find an existing G/L Entry (so it really was attempting to use an entry no. that existed), but the last few times i tried to post it, it has been throwing entry nos. that do not yet exist (say, several nos. higher than the highest G/L Entry no.).
as i mentioned - no recent changes and so far only this PO is impacted. the last thing i can think to do is watch the entire posting through debugger - which users will not like as i lock them out.
we are on NAV 3.7b with 5.0 clients sitting on a SQL db. Thanks in advance for any suggestions on where to look.
I have a single Purchase Order that will not Post Invoice. The receipt was already posted, and now A/P is trying to invoice the receipt.
When you attempt to invoice (or receive and invoice), you get an error:
Microsoft Dynamics NAV
The G/L Entry already exists.Identification fields and values:Entry No.='XXXXXXXX'
OK
If you attempt to post again, you get the same error, alhtough the entry no. changes. We have a lot of mods in our system, but nothing was recently changed in the posting objects and this only seems to be impacting this one purchase order. any ideas on where i can start looking?
I ran with debugger active (no breakpoints) and found that it is stopping in Codeunit 12 Gen. Jnl.-Post Line\FinishCodeunit() at this point:
FinishCodeunit() WITH GenJnlLine DO BEGIN IF GLEntryTmp.FIND('-') THEN BEGIN REPEAT GLEntry := GLEntryTmp; IF GLSetup."Additional Reporting Currency" = '' THEN GLEntry."Additional-Currency Amount" := 0; GLEntry.INSERT;
Initially, i was able to find an existing G/L Entry (so it really was attempting to use an entry no. that existed), but the last few times i tried to post it, it has been throwing entry nos. that do not yet exist (say, several nos. higher than the highest G/L Entry no.).
as i mentioned - no recent changes and so far only this PO is impacted. the last thing i can think to do is watch the entire posting through debugger - which users will not like as i lock them out.

we are on NAV 3.7b with 5.0 clients sitting on a SQL db. Thanks in advance for any suggestions on where to look.
kind of fell into this...
0
Comments
-
more info -
i found why the no. seems to exceed the highest G/L entry no., in the process discovering which
PO line is the culprit.
The PO has 4 lines, and the 3rd line is the one causing the fault. the first two lines appear to create 3 g/l entry (NextEntryNo is called 3 times before the error anyhow).
i guess i have a place to start looking now.. InitCodeUnit from CU 12...kind of fell into this...0 -
I have seen this before. Some time ago, it was due to two lines that were identical and the way that the posting buffer merged them, (not sure if it was purchase or sales, but I think sales). It related some where to a modification, the client was using eShip and Warehouse management, and it was a mod to one of them that did it. Basically a filter or something was not doing what it should have.
Sorry it was a number of years ago and if I remember correctly we couldn't fix it, and in the end just inserted a new line for 1 penny in between the two lines, and had to play around (in a test db) with posting different lines in different sequences till it posted. Then a lot of adjustments to make it work.
Basically try posting one line at a time (set qty to invoice to zero on all but one line) and get it out of the system and move on.David Singleton0 -
this usually is related to mod.
The mod uses a different variable for CU 12 instead of using the same variable in CU 80 or 90.
This causes an entry to posted inbetween the entries and Std variable is not aware since it keep the EntryNo as variable.
I suggest to look and see if there is any mode that post to GL using CU 12 that is a new variable.0 -
we do have eShip.
the first line is an item line. the second line is a resource line. the third line is an item. it seems like it never gets a nextentry no between the second and third line. i learned what i have so far by stepping through debugger and getting lambasted by the users for locking everyone out. i guess i'll see if i can recreate this in my development environment.
thanks for the input! i will take your suggestion (posting 1 line at a time) as a last resort if i cannot find the culprit.kind of fell into this...0 -
i will add that the resource line has a job assigned to it.
i dummied up the PO in my development system (minus the job no) and was able to post it, so i wonder if the job impacts it somehow?
test that next...kind of fell into this...0 -
If I remember correctly 3.70 did not allow posting job lines on purchase orders, so it would seem you have mods made in that area, so that looks like the right place to check.
I think though just post the resource line on its own delete the line then post the rest of the order.David Singleton0 -
thanks - like i said, lots of mods in our system... :shock:
i just stepped through a recreated error scenario.
for the first line, the system loops through the inventory posting buffer twice, creating two GL Entries. It then leaves this loop. CU 90 then calls CU 202 which calls report 1214 and the Post Job WIP Value to G/L code is fired. i saw it generate another 2 G/L entries (incrementing properly). code then started posting for 3rd line and when it returned to CU 12, i saw that the NextEntryNo was the value last incremented during the posting of the first item - the resource line must call a different instance of the CU 12 and incremented "outside" of the transaction in a sense.
i know accounting would prefer to post the invoice as received from the vendor, so i am going to dig deeper and try to find how it can be corrected.
thanks again!kind of fell into this...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions