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

Announcements

No record found.

News and Announcements icon
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.

  • Martin Dráb Profile Picture
    241,635 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
    241,635 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
    241,635 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
    241,635 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287 Super User 2026 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 232 Most Valuable Professional

#3
Aayush Tiwari Profile Picture

Aayush Tiwari 222

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans