The Ledger Entry Dimension already exists.

ducnguyen
Member Posts: 8
I try to create a codeunit to post a payment by payment journal but I facing an error:
Any advice?
Thank you so much.
The Ledger Entry Dimension already exists. Identification fields and values: Table ID='271',Entry No.='2788',Dimension Code='DEPARTMENT'
Any advice?
Thank you so much.
0
Answers
-
What do you do with TempJnlLineDim?0
-
Have you checked which is the last Bank Account Ledger Entry in your database? It should be 2787 (since apparently running this code creates Entry No. 2788). Next, also check the Ledger Entry Dimension table...there should exist no records for Table-ID=271, Entry No.=2788. If that is the case, maybe someone deleted a Bank Account Ledger Entry without deleting the attached Ledger Entry Dimensions...I would check this first, since your code seems to be OK.Theunis Modderman
DSA Global Solutions bv
Hoofddorp- The Netherlands
t. +31 - 23 737 0 484
m. http://www.dsa-gs.nl0 -
Thank for your comment Theunis
I just check data in the database and saw anything to be OK. Please see attached:
So I don't know why the reason for this issue (I use NAV 2009 R2). Please give me your advice
Thank so much!
0 -
Did you set the Property Temporary for your variable TempJnlLineDim to Yes? Did you check the Ledger Entry Dimension table for records linked to Table-ID 271 (your screenshot shows table 17...)
By the way: your code is causing troubles anyhow. You are using a 'real' GenJnlLine-record, which you insert in Table 81. By validating the Account No. and Bank Account No., this will create (if applicable) also corresponding Journal Line Dimensions. These dimensions will however not be copied to the Ledger Entry Dimension-table, since that happens with the records in the TempJnlLineDim-=table. If you would e.g. have a Global Dimension 1or 2 linked to the Vendor or to the Bank account, these values would appear in your Ledger Entries (G/L, vendor, Bank Account) but not in your Ledger Entry Dimension tables. For example your Analysis View Entries would not match your G/L Entries. Better is to copy the Journal Line Dimensions to the TempJnlLineDim table...Theunis Modderman
DSA Global Solutions bv
Hoofddorp- The Netherlands
t. +31 - 23 737 0 484
m. http://www.dsa-gs.nl0 -
Theunis_Modderman wrote: »Did you check the Ledger Entry Dimension table for records linked to Table-ID 271 (your screenshot shows table 17...)Theunis_Modderman wrote: »Did you set the Property Temporary for your variable TempJnlLineDim to Yes?A dimension used in Gen. Journal Line PAYMENT, GENERAL, 20000 has caused an error. Select a Dimension Value Code for the Dimension Code AREA for Vendor 20000.
Sorry I don't understand what you explain, I'm a newbie so many thank if you can help me resolve it.0 -
// First clear the temporary table
TempJnlLineDim.DELETEALL;
// Now copy all Journal Line Dimensions to the Temp-table
JnlLineDim.RESET;
JnlLineDim.setrange("Table ID",database::"81");
JnlLineDim.setrange("Journal Template Name",GenJnlLine."Journal Template Name");
JnlLineDim.setrange("Journal Batch Name",GenJnlLine."Journal Batch Name");
JnlLineDim.setrange("Journal Line No.",GenJnlLine."Line No.");
IF JnlLineDim.findset then
repeat
TempJnlLineDim := JnlLineDim;
TempJnlLineDim.INSERT;
until JnlLineDim.next = 0;
GenJnlPostLine.RunWithCheck(GenJnlLine, TempJnlLineDim);
By the way...this is not a training institute. You cannot expect people to write your code for you.Theunis Modderman
DSA Global Solutions bv
Hoofddorp- The Netherlands
t. +31 - 23 737 0 484
m. http://www.dsa-gs.nl1 -
Theunis_Modderman wrote: »By the way...this is not a training institute. You cannot expect people to write your code for you.
Thanks Theunis. I'm don't expect who to write code for me, just hope have someone can give me a solution or something like that so I can resolve my issue0
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