Blog

Microsoft Dynamics AX Thoughts

2

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:
  1. Backing-up my database (just in case that anything went wrong)
  2. Exporting the data of that table (from the AX Import/Export functionality)
  3. Deleting/Dropping the table from the Microsoft SQL Server Management Studio (by this all the data of course will be deleted)
  4. Opening the Dynamics AX client, going to: AOT –> Data Dictionary –> Tables –> LedgerJournalTrans –> Right clieck –> Synchronize
  5. 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. :)

2 Comments to “Error: Cannot create a record in . The record already exists”

  • 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 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! :)

Post comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Dynamics AX 2012 Event

Recent Posts

Tags

Archives

Random Testimonial

  • ~ Muzammil Ahmad, ERP Manager at Abdul Aziz Alsorayai Investment Group

    33a1e92"Thing that I have seen in Amer in a broader view, that, he is a type of guy who takes the tasks in a professional way,concentrate on tasks, work on them with a cool & calm mind but fullfil the tasks in time. Having a humble nature, its normally a pleasure for everyone to work with Amer"

  • Read more testimonials »

Posting tweet...

Powered by Twitter Tools