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:
IF "Parameter String" <> ” THEN BEGIN
JobQueueEntry := Rec;
REPORT.RUN("Object ID to Run",FALSE,FALSE,JobQueueEntry);
REPORT.RUN("Object ID to Run",FALSE);
Attached is report 50003 that does the job.