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

How to test and investigate batch job ?

(0) ShareShare
ReportReport
Posted on by 552

Hi guys,

Need advices on how to test and investigate when something happened in batch job ?

I'm running batch job for my custom RunBaseBatch, This batch job supposedly looking at my tables, and with the test run, I have 3 records un-processed, there are flag to identify it. While all 3 records updated (means it is retrieved and processed), the subsequent process result seems to be only the 1st one.

In that class, I have error handling, but no information appears of any error, also the 1 result coming trough also not really finished, but it also no error being informed. In this subsequent process, which create record in another custom table, I also have log table when something happened, but this too not working (no records in error log). If it is not from batch process, all this error handling is working properly. FYI, this RunBaseBatch class also able to run in ad-hoc manner, so I can run manually by a button.

While this is a custom process, which of course I need to debug my self, need advice what is the best approach and what steps I should go through in order to investigate this.

Thanks,

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    Hi Ken,

    You can add Info log button on the required areas, and you can see the info message under System administration >> Inquiries >> Batch jobs >> Select your batch job >> Click on Batch job history button on the action pane >> On the action pane you can see the Log button >> Clicking on this button will show you the output of the info log you added.

    https://dynamics365musings.com/debug-d365-batch-jobs/

    Thanks,

    Girish S.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi Ken, We have automated entire process on click of button and faced similar issues during batch jobs. Two main issues were in which step the batch job was failed and why it failed. We created a base enum for Steps like validate, createRecord etc and in log table inserting the info message to show which error was thrown. So when executed from batch job or manually, you can check status and log table. The way we designed it was if it failed on certain step, next time when user execute the process after fixing the issue, code will be executed from that failed step only.

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