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

unable to send batch job execution history while record insertion in BatchJobHistory table

(0) ShareShare
ReportReport
Posted on by 20

I need to send logs to AppInsight for batch job execution details. I tried to add my custom code in insert method of BatchJobHistoyTable, but it's never get executed. Because records created though set based operation. ProcessedFinishedJobs method in BatchProcessFinishJobs class creating records in BatchJobHistory table and this class is internal, all method in this class are private. Please help me where I can add my custom code so that when batch job execution is completed , I can send those details to AppInsight.

I have the same question (0)
  • Martin Dráb Profile Picture
    237,783 Most Valuable Professional on at

    If it's about Dynamics AX, please tell us which version you're using. If it's about F&O, let me move this thread to the right forum.

  • Arti bharane Profile Picture
    20 on at

    Hi Martin,

    Yes it's about Dynamics 365 F&O and the application version is 10.0.30

    Platform release - PU54 (7.0.6592.89). It would be helpful if you move this thread to respective forum.

    Thank you !!

  • Martin Dráb Profile Picture
    237,783 Most Valuable Professional on at

    Moved to Dynamics 365 Finance Forum. The category changed to Development / Customization / SDK.

  • Suggested answer
    Martin Dráb Profile Picture
    237,783 Most Valuable Professional on at

    I think you should focus on BatchRun class.

    For example, what about subscribing to processFinishedJobsSendAlertsDelegate? It's what the system itself does to send alerts.

  • Arti bharane Profile Picture
    20 on at

    Hi Martin,

    Thanks for your replies and suggestions.

    processFinishedJobsSendAlertsDelegate method of BatchRun class , always has null value for BatchHistory and BatchJobHistory buffer. I need this table buffer with values.

  • Verified answer
    Martin Dráb Profile Picture
    237,783 Most Valuable Professional on at

    Note that history is not logged in all cases. For example, no history is logged if the job succeeded and its LogLevel isn't set to Always.

    If you're interested only in situations when history was logged, simply skip your logic if no history is available.

    If you want to log information about all batches, even if they don't write anything to history, using the BatchHistory and BatchJobHistory tables doesn't meet your actual requirements.

    If you want to know what exactly happens in your case, debug code in BatchRun::serverProcessFinishedJobs().

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

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 364 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans