web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Batch job not ending

(4) ShareShare
ReportReport
Posted on by 130
Hi,
We experimented a situation yesterday. We created 3 batch jobs
1- Create Collection letters for one iteration
2- Post Collection letters for one iteration
3- Send the Collection letters to customers for one iteration
 
1 and 2 executed successfully one iteration BUT 3 started sending in a loop many collection letters to the same customers until we have stopped manually this batch job
 
This was certainly a bug, how can we prevent this situation to happen again.
 

Thank you !
Kamel S 
Categories:
I have the same question (0)
  • Verified answer
    Jonas "Jones" Melgaard Profile Picture
    4,980 Most Valuable Professional on at
    Hi Jamel S,
     
    Did you see any exceptions during the collection letter run?
    There is a similar issue report in LCS.
     
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,390 Super User 2025 Season 2 on at
     
    I think you need to create a MS ticket.
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Suggested answer
    Saif Ali Sabri Profile Picture
    2,351 Super User 2025 Season 2 on at
    Thank you for the details shared. Based on the issue observed—where the batch job for sending collection letters ran in a loop and repeatedly sent letters to customers—this behavior aligns with known system design in Dynamics 365 Finance and Operations.
    As confirmed by the Microsoft documentation, if multiple tasks are queued in a single batch job and one of them fails (due to an exception), the entire batch job restarts from the beginning—potentially executing successful steps again. This can result in duplicate sending of collection letters, especially if retry attempts are configured (default is up to 6 retries). This behavior is not a bug but by design, as also noted by Mr. Jonas and Mr. Mohamed.
    ✅ Recommended Actions to Prevent Recurrence:
    1. Separate the Batch Jobs:
      • Do not group "Create", "Post", and "Send" steps in a single batch job.
      • Instead, configure them as separate batch jobs, scheduled sequentially or controlled via workflow/Power Automate.
    2. Set Retry Count to Zero for Sending Task:
      • Navigate to System Administration > Batch Jobs, locate the "Send Collection Letters" job, and set "Maximum retries" = 0.
      • This avoids unintended repeats on failure.
    3. Implement Idempotency in Sending Logic:
      • Ensure the process checks if a letter is already sent (e.g., by status field or timestamp) before sending again.
      • This prevents duplicates, even if the task is retried.
    4. Monitor Exceptions Closely:
      • Review Batch job history and Exception logs to identify root causes (e.g., email errors or report failures).
      • Resolve any recurring failure points that may trigger retries.
    5. Review Similar Known Issues in LCS:
      • As mentioned by Mr. Jonas, check LCS Issue Search for existing reports under keywords like "collection letter resend" or "batch job retries".
      • If the issue matches, Microsoft may already have a fix or workaround available.
    6. Raise a Microsoft Support Ticket:
      • If the above safeguards are applied and the issue persists, consider raising a support request to Microsoft for further investigation—especially if using standard, non-customized logic.

  • Suggested answer
    Abhilash Warrier Profile Picture
    5,402 Super User 2025 Season 2 on at
    Hi Kamel,

    Just wanted to mention the workaround for this issue.

    To limit the retry attempts for a batch job in Dynamics 365 Finance, especially to avoid unwanted loops like the one you faced with collection letter sending, here's the precise method:

    How to Set or Limit Retry Count for Batch Jobs
    Step-by-Step Instructions
    1. Navigate to System Administration
      • Go to System Administration > Inquiries > Batch jobs
    2. Locate the Specific Batch Job
      • Find the job (e.g., Send Collection Letters) that caused the loop.
      • Click on the Batch job ID to open details.
    3. Open Task Details
      • In the Batch job form, go to the Batch tasks FastTab.
      • Select the relevant task (usually Step 3 in your flow) and click View Task Details.
    4. Set Maximum Retry Attempts
      • In the task configuration, locate the field Maximum retries.
      • Change it from the default (usually 6) to 0.
    5. Save and Monitor
      • Save the changes and keep an eye on batch exceptions in case further tuning is needed.

    Pair this with splitting your batch logic (Create, Post, Send) into individual jobs, as retries apply per job—not per task within a grouped sequence.

    If this helped, please mark it as "Verified" for others facing the same issue.
    Keep in mind that it is possible to mark more than one answer as verified.
  • Verified answer
    Alireza Eshaghzadeh Profile Picture
    14,679 Super User 2025 Season 2 on at
    Hi,
    For 3 you need to check further parameters that you have chosen. If you mean it is correct, you need to create a support case to Microsoft.
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans