Blog
Microsoft Dynamics AX Blog
Sometimes you might face an unexpected error when trying to insert new records to any of the Dynamics AX tables. The message you might have is like: Cannot create a record in Journal lines (LedgerJournalTrans). The record already exists.
You might also have tried to check the indexes of this table that shouldn’t be duplicated. And you got surprised when you are not violating those constraints, so there is no any rational reason why this error might appear.
After so many tries, I got to fix that error by:
- Backing-up my database (just in case that anything went wrong)
- Exporting the data of that table (from the AX Import/Export functionality)
- Deleting/Dropping the table from the Microsoft SQL Server Management Studio (by this all the data of course will be deleted)
- Opening the Dynamics AX client, going to: AOT –> Data Dictionary –> Tables –> LedgerJournalTrans –> Right clieck –> Synchronize
- Importing the data again to all companies (from the AX Import/Export functionality.
As you could see, I got this error in a very critical table that is the LedgerJournalTrans table. This table contained already posted lines and it was really headache for me to get it fixed. But fortunately I was able to fix it by following the previous steps.
Search the site
Dynamics AX 2012 Event
Recent Posts
- D365FO | Cannot Connect to SQL Server Database on Your Cloud Test Machines
- Intro to Microsoft Dynamics AX in Arabic – سلسلة حلقات مايكروسوفت داينامكس إيه إكس بالعربية
- Microsoft Dynamics Launch – Sunday, 24th February – Intercontinental Hotel, Riyadh
- Files of Our AX Brains Dec 2012 Event
- It was a great day!
- Tomorrow is the day for our Dynamics AX Brains Technical Seminar
- Dynamics AX Brains December 2012 Technical Seminar
- Windows Server 2012: Built from the Cloud Up
Tags
.NET
.NET Business Connector
AIF
Amer
Arabic
Architecture
Book
CLR Interop
Community
Database
Development
Dynamics AX
Dynamics AX 6.0
Dynamics AX 2009
Dynamics AX 2009 SP1
Dynamics AX 2011
Dynamics AX 2012
Dynamics AX Brains
Enterprise Portal
Error
Event
GDC
Hijri
IIS
Implementation
Integration
Kerberos
Ledger Journal
Materials
Microsoft stack
MorphX
MSDynamicsWorld.com
ODC Files
Presentation
Sales Order Web Service
Saudi Arabia
SureStep
Training
VISUAL STUDIO.NET
WF
Workflow
Workflow Approval
Workflow Task
X++
X++ Editor
Archives
- October 2019 (1)
- January 2014 (1)
- February 2013 (1)
- December 2012 (4)
- September 2012 (2)
- December 2011 (2)
- November 2011 (3)
- July 2011 (3)
- June 2011 (4)
- May 2011 (3)
- April 2011 (4)
- March 2011 (12)
- February 2011 (2)
- January 2011 (3)
- December 2010 (1)
- November 2010 (1)
- October 2010 (5)
- August 2010 (1)
- July 2010 (3)
- June 2010 (4)
- May 2010 (5)
- April 2010 (1)
- March 2010 (9)
- February 2010 (4)
- January 2010 (4)
- December 2009 (11)
- September 2009 (1)
- August 2009 (1)
- July 2009 (2)
- September 2008 (1)
Random Testimonial
- ~ Ziad Yehia, ERP Business Consultant at NetWays
"I have one thing to say about Amer, When you have a tough Dynamics AX question that you are not able to answer; he is the person to call..."
- Read more testimonials »
Hi Amer,
Thanks for your post. Your solution seemed reasonable but a little drastic. I attempted a less involved fix by adding a dummy field to my table, which forced a re-synchronise, then I removed the dummy field (another synchronise). This seemed to have the desired effect, although I should note that we only encountered your error message (also on the LedgerJournalTrans table) occasionally, so the underlying cause may have been slightly different.
Hi Amer,
Thanks in advance ..
I am also facing same error during the time of free text invoice , for correction invoice … error
Record already exists ..in custimvoicetable ..
Please help me ..
Regards
Shardendu Prakash sharma
Hi Nathan,
Thank you very much for your post.
I believe so yes, the underlying cause is different. Well, in my case, I was unable to open, synchronize successfully, nor adding/deleting/modifying any of the table’s fields. Thats why I had to go directly to the SQL Server and check that out there. Although I always recommend not to touch the database from the back-end… but it looks sometimes that you have no other choice.
Thanks again Nathan!
HI amer ,
thanks for the post this one.
this is very help for me.
Hi Amer,
I would be careful deleting a table like that. When you import a table using the build-in import/export functionality you create new rows in that table. Thereby that rows get new RecId-values.
Now the problem that there are a few tables that references entries in LedgerJournalTrans by RecId but their reference values are not refreshed by that import method. Thats why you should test if you have produced database/reference errors by your ‘fix’.
Hi All, i have similar issues , when we try to create new journal in AX 2011 , then error displayed “Cannot create record in LedgerJournalTable the record already exists”, we try to delete (by SQL) all records in the AX number sequece temporary table : “DELETE FROM NUMBERSEQUENCELIST” ,,, the trouble fixed …