While trying to process import of general ledger entries (general journal), we got the following error on execution:
Cannot create a record in Ledger journal table (LedgerJournalTable).
The record already exists.
We checked and did everything from status list on number sequence to clearing the staging table as well as synchronizing the database, but finally found the issue was related to data.
I am providing a sample (2 records) snapshot of data that we were trying to import:
GL_MZKFAI 5101400-66-- Ledger 0.000000 PKR 59.060000 GL line 1 GL_MZKFAI 2019-09-30T00:00:00 1 GL_MZKFAI 1074008--- Ledger 106.270000 PKR 0.000000 GL line 2 GL_MZKFAI 2019-09-30T00:00:00 1
And the issue was the field "Description" - The line description which should have been mapped to the field "Text" was mapped to the former field.
The field "Description" represents the journal (header) description and it should be the same throughout the file if the intention is to load all files into a single journal only.
Refer Best practices for importing vouchers by using the General journal entity for general guidelines regarding the general ledger (GL) or general journal import.
After the input file was corrected, we were successfully able to import the general ledger (GL) entries into D365 via "General journal" entity (LedgerJournalEntity) through DMF data management project.