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, ...
Suggested Answer

Batch job - Distributing workload by from from code dynamically create multiple batch jobs

(0) ShareShare
ReportReport
Posted on by 50

Batch job - Distributing workload by from from code dynamically create multiple batch jobs

Our scenario is that we have a customized function the create project invoices for all projects that projects with chargeable transactions.

Initially all this work was handled by a single batch task in batch job. The customer has many many projects so the batch job could take a whole day to complete.

  • We made an attempt to let a "main"-task in batch find and loop over all projects with chargeable transactions.
    • From this one batch task per each ProjectId is created.
  • The above works fine...
  • ...but after a successfull batch-run all the ProjectID-tasks are kept in the batchjob.
  • So when the same batchjob is started up again (due to recurring schedule) all the tasks from the previous run are still remaining in the batchjob.
    • The goal would be to that at each new run the batchjobn should only consist of the "main"-task that locates all ProjectId:s and create a new fresh set of batch tasks

So our problem is how to get e "clean sheet" at each startup of a new batch run.

Is there any "best practice"-way to achieve what i describe above?

I have the same question (0)
  • Suggested answer
    WillWU Profile Picture
    22,361 on at

    Hi partner,

    Does batch job history clean-up periodically meet your requirement?

    docs.microsoft.com/.../batch-history-cleanup

  • MagnusBjelksjo Profile Picture
    50 on at

    No, sorry, that it not the answer to this. The solution we currently have chosen is to clear the previous batch tasks at the next startup. So for a period of time the batchjob (when in status Waiting) is consisting of batch tasks fro previous run. But those are cleared later.

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 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans