Month: August 2025

  • Enhancing Batch Job Monitoring in D365 F&O with a Custom Email Alert Solution

    Monitoring batch jobs is a critical task in any Dynamics 365 Finance & Operations environment. One effective way to stay informed about issues is by setting up email alerts specifically for failed batch jobs. This blog walks you through the setup process and highlights an optional customization to capture detailed failure information.


    Prerequisites

    Before enabling batch email alerts, ensure the following configurations are complete:

    1. Email Parameters Configuration
      First, configure the system-wide email parameters by following the steps outlined in the official Microsoft documentation:
      Configure email parameters in D365 F&O
    2. User Email Provider Setup
      Once the global email setup is complete, navigate to:
      User Options > Account > Email provider selection
      Here, configure:
      • Email Provider ID
      • Sender Email (typically your logged-in user email)

    This implementation leverages a utility class named DFTGetInfologMessages, previously detailed in an earlier blog post.


    Enabling Batch Email Alerts

    With the above configurations in place, you can now enable alerts for batch jobs:

    1. Navigate to System administration > Inquiries > Batch jobs
    2. Select the batch job you want to monitor
    3. Click on the Alerts button in the Action Pane
    4. Enable relevant conditions; for failure notifications, set the Error and Email flags to Yes

    You can enable alerts for both new and already scheduled batch jobs.

    More details on configuring alerts are available here:
    👉 Manage alerts in Dynamics 365 F&O


    Standard vs Custom Email Alert Details

    By default, standard email alerts in D365 F&O provide only high-level information about batch job failures—often not enough for deep troubleshooting. If your business requires more granular details (like error messages or failed task data), consider implementing a small customization to enhance the alert payload. This approach allows tailoring the email content based on specific business requirements.

    Step-by-Step Customization Guide

    1. Create a Temporary Table

    This table will store detailed failure messages to be included in the email body.

    • Name: DFTBatchFailureDetailsTmp
    • Fields:
      • Title
      • TaskLog

    2. Extend System Parameters Table

    • You can use any global configuration table or create a dedicated extension to manage email settings.
    • Add the following fields to your table extension:
      • EnableBatchEmailTemplate
        • Type: Enum (NoYes)
        • EDT: NoYesId
        • Label: Enable custom email template
        • Help Text: Enabling this flag will send email in custom template format for failed batch jobs.
      • BatchEmailText
        • EDT: smmCampaignBroadcastText
        • Help Text: Email body text for batch job alert

    3. Expose Custom Fields to the UI

    • Extend the relevant form to include these new fields, allowing system admins to configure the alert settings directly from the user interface.

    Add below html text in BatchEmailText and set EnableBatchEmailTemplate flag value to Yes.

    4. Customize the Email Notification Logic

    • Create a CoC (Chain of Command) extension for the EventNotificationBatch class.
    • Override the logic to replace the default email body with a custom HTML/text body using the values from your temporary table and configuration.

    Once this setup is in place and the custom email template option is enabled, the system will automatically send detailed failure information through email, offering greater insight than standard alerts.

    This solution empowers admins and support teams to act quickly and efficiently by providing actionable failure details—without having to manually investigate each batch job issue.


    Keep your operations running smoothly by proactively monitoring failed batch jobs—and don’t hesitate to customize when the out-of-box solution falls short!

    #Xpp #D365FO #ERP #BatchJob #Integration