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 :
Microsoft Dynamics AX (Archived)

Restart the failed batch job

(0) ShareShare
ReportReport
Posted on by 11,633

Hi All,

Just wanted to know if it is possible to restart a failed batch job, from the point where it fails?  Like there are 30 tasks inside a batch job and 20 of them ran successfully, but after that one of the task fail which in turn resulted in batch job failure. Is it possible to restart the batch task from task # 21? I looked at batch task form, and couldn't find any option related to this.

Thanks,

SB.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    As per my understanding.. there is no option to restart the task...

    may be you should consider restarting Batch job... so that remaining task should run again...

    I suggest you to look into your logic how you have created tasks

    you should implement coding using Try..Catch and implement retry option if error occurs

    other point what you need to look into is related to how you are throwing your error.. you need to check your logic so that if one task returns a error even though next task should run...

    Please verify and update us with your findings.

  • André Arnaud de Calavon Profile Picture
    301,025 Super User 2025 Season 2 on at

    Hi Syed,

    It depends on the tasks you are performing. If it is about 30 different jobs you could condider creating 30 batch jobs in stead of 1 job with 30 tasks.

    If the tasks are related and depending on each other, there is no option to do a restart at the point where it failed.

    If it is about one job, but work is devided into 30 threads, you can consider changing the logic, so each part will become a separate batch job in stead of a task within one job.

    So, can you provide some more details?

  • Suggested answer
    Community Member Profile Picture
    on at

    You must use proper transaction block in your code. In your case you may consider each task as 1 transaction and ttsBegin and ttsCommit can be use here in a try block and whenever exception raise you should rollback the transaction in catch block using ttsAbort. This way it will only consider unprocessed records every time you initiate the job.

    Thanks,

    Imran

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans