Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Cannot create a record in Job runs (DMFExecution). The record already exists.

(0) ShareShare
ReportReport
Posted on by 25

Hi,

I have a DMF processing group that runs as a batch job that runs daily looking for the existence of new files in a folder and create GL transactions. The batch could run for weeks without any issues until the error appears. It seems like DMF assigns the same Job Id again and again causing a duplicated index issue. After debugging the issue I got into the method and class that the system uses to create the Job Id. For some reason the DateTimeUtil::getSystemDateTime() method is getting the same date-time again and again. When AOS service is restarted, the batch job starts working again, and as I mentioned before it could work for weeks without issues.

Do you know of any issues with that method?

Why an AOS service restart temporarily fix the issue?

This is the error message. The system will try to insert the same job id every time it runs.

pastedimage1611255095843v2.png

This is the part of the code that the job id is created.

pastedimage1611254647286v1.png

  • Andre Kruijer Profile Picture
    Andre Kruijer 5 on at
    RE: Cannot create a record in Job runs (DMFExecution). The record already exists.

    Hi Martin,

    I was wondering if you could resolve the issue. I have exactly the same problem. In my case I run a DIXF job every 15 min. and it went fine for months, but I get the same problem as you have. The strange thing is that it I get an error message about records that exist with an ExecutionID of a number of days ago and sometimes it end the job successfully.

    pastedimage1617698977215v2.png

    Any new info on this topic?

    Thank you.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,979 Super User 2025 Season 1 on at
    RE: Cannot create a record in Job runs (DMFExecution). The record already exists.

    Hi Nitram,

    It would be possible to extend the length of the Execution ID field. You can also create a processing group with a shorter name, so there will be more characters left for the numbering.

    Have you tried to change the coding to retrieve the date/time stamp?

  • NitramE Profile Picture
    NitramE 30 on at
    RE: Cannot create a record in Job runs (DMFExecution). The record already exists.

    Hi André,

    Thanks for your quick response.

    Is this execution id configurable?

    Where in AX it can be changed?

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,979 Super User 2025 Season 1 on at
    RE: Cannot create a record in Job runs (DMFExecution). The record already exists.

    Hi Martin,

    You have a configuration of execution ID, date/time and a file sequence number. When the date/time will be the same (not sure why), the file sequence number will be the only part that makes the execution ID unique.

    The Execution ID has a limited length. It might be the case that it can truncate the string when a new file number added to the string will exceed the maximum length of the Execution ID field.

    Instead of the method DateTimeUti::getSystemDateTime(), you can try to use 'DateTimeUtil::utcNow()'

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,979 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans