E-Mailing PDF Report with Job Queue

One of my clients asked for a automated report delivery every morning.  Since Job Queue was already running I decided to create a way to have Job Queue print the report to PDF and email it as an attachment.

This example uses the E-Mailer Report no. 50003 to send Report No. 6 to my email address.

First I had to make some changes to codeunit 449, Job Queue Start Codeunit, the OnRun trigger.  I created a local variable with the name JobQueueEntry as a Record 472 and then added to the code.
[code htmlscript=”false”]CASE "Object Type to Run" OF
"Object Type to Run"::Codeunit:
CODEUNIT.RUN("Object ID to Run",Rec);
"Object Type to Run"::Report:
//#01
IF "Parameter String" <> ” THEN BEGIN
JobQueueEntry := Rec;
JobQueueEntry.SETRECFILTER;
REPORT.RUN("Object ID to Run",FALSE,FALSE,JobQueueEntry);
END ELSE
//#01
REPORT.RUN("Object ID to Run",FALSE);
END;[/code]
Attached is report 50003 that does the job.

Any Report E-Mailer

4 Replies to “E-Mailing PDF Report with Job Queue”

  1. I need to send mail two times every morning and evening from one codeunit through,using job queue+navision 2013 r2.

    1. I need to sent One PDF file at every Morning 8:00 am and same pdf is also need to send at evening 7:30 pm daily ,Using Job queue +navision 2013 r2.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.