Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

Job Queue Error Notification

Posted on by 148
Is there a way to get some kind of notification, like an email, when a job queue tries to run and errors?
Categories:
  • Suggested answer
    Valentin Castravet Profile Picture
    Valentin Castravet 6,908 Super User on at
    Job Queue Error Notification
    That's good. As an aside, looks like this feature will be available out of the box in the new fall 2024 update - https://learn.microsoft.com/en-us/dynamics365/release-plan/2024wave2/smb/dynamics365-business-central/get-notified-about-issues-job-queue-background-processing
     
  • Brett F Profile Picture
    Brett F 148 on at
    Job Queue Error Notification
    Thanks all!  We were lucky enough to find that an extension we had purchased for different features includes a job queue error email alert feature and it has been great!
  • Suggested answer
    Valentin Castravet Profile Picture
    Valentin Castravet 6,908 Super User on at
    Job Queue Error Notification
    As the other users mentioned its not possible to do out of the box, you will need to customize the system to do it, or use other tools to do it. 
     
  • Suggested answer
    Manish Sharma Profile Picture
    Manish Sharma 8 on at
    Job Queue Error Notification
    We did this for a customer in NAV & then carried it in Business Central, you can try below by creating a codeunit, hope this helps,
     
    Codeunit 50000 "Send Job Queue Staus Email"
    {
        TableNo = "Job Queue Entry";
        trigger OnRun()
        begin
            case Rec.Status of
                Rec.Status::Error:
                    begin                   
                            Clear(EmailMessage);
                            Clear(Email);
                            ToRecipients := 'xyz@abcmail.com';
                            EmailSubject := 'Error in Job Queue - ' + format(Rec."Object ID to Run");
                            EmailBody := GetErrorDescp(Rec.ID);
                            EmailMessage.Create(ToRecipients, EmailSubject, EmailBody, true, CCRecipients, BCCRecipients);
                            Email.send(EmailMessage);                   
                    end;
            end;
        end;
     
        var
            EmailSubject: Text;
            EmailBody: Text;
            EmailMessage: Codeunit "Email Message";
            CCRecipients: List of [Text];
            ToRecipients: List of [Text];
            BCCRecipients: List of [Text];
            Email: Codeunit Email;
     
    local procedure GetErrorDescp(JobId: Code[250]): Text
        var
            JobQueueLogEntry: Record "Job Queue Log Entry";
        begin
            JobQueueLogEntry.Reset;
            JobQueueLogEntry.SetRange(JobQueueLogEntry.ID, JobId);
            if JobQueueLogEntry.FindLast then
                exit(JobQueueLogEntry."Error Message");
        end;
    }
  • Leslie C Profile Picture
    Leslie C 20 on at
    Job Queue Error Notification
    I was able to set this up with Power BI. I created a Power BI report with a card that monitors the errors. I then set an alert on this card that if an error occurs, I get an email. No code needed, just Power BI.
  • Suggested answer
    Sabina Sasu Profile Picture
    Sabina Sasu 19 on at
    Job Queue Error Notification
    Hi Brett,
    Unfortunately there are no out-of-the-box features that allow those actions.
    However, you can navigate to the Extensions Marketplace and download a free extension called LIDD Job Queue Alerts.
     
    We developed this extension for customers that had the same requirements as you. 
    It allows you to send email notifications when a job queue fails, and to restart it automatically.
     
    Let me know if you have any questions!
     
     
    Sabina
    Software Developer
    LIDD Consultants Inc.
     
     
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 63,922 Super User on at
    Job Queue Error Notification
    Hi, as far as I know, it can't be done in the standard.
    You can use AL to customize an extension to let the system automatically send emails.
    Or you can use Power Automate to send a message when an error detail is created.
     
    Hope this can give you some hints.
    Thanks.
    ZHU

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,773 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,513 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans