Hi Stefano,
i will send report using job queue it will send the mail automatically and need to set filter based on my form customer ids automatically.
Path := 'C:\\Temp'+PdfDocPath;
path2 := 'C:\\Temp1'+pdf2;
CLEAR(CustomerLedgerReport); // AccountsPayable is a Report 322
CustomerLedgerReport.USEREQUESTPAGE(FALSE); //// for filteration
CLEAR(AccountsReceivable); // AccountsReceivable is a Report 12
AccountsReceivable.USEREQUESTPAGE(TRUE);
EVALUATE(PeriodLength,'3D');
DateAsOf := 240119D;
AccountsReceivable.InitializeRequest(DateAsOf, AgingBy::"Due Date", PeriodLength, TRUE, TRUE, HeadingType::"Date Interval", FALSE);
IF NOT AccountsReceivable.SAVEASPDF(path2) AND CustomerLedgerReport.SAVEASPDF(Path) THEN
ERROR('PDF Creating Failed!\\ERROR:\\' + GETLASTERRORTEXT);}
//seremail.SETRANGE(No,No);
SMTP.CreateMessage('wood','Dillibabu@gmail.com','','outstanding amount','',TRUE);
SMTP.AddCC('ashwini.e@sharpsyssoft.com');
SMTP.AppendBody('Dear Sir / Madam,');
SMTP.AppendBody('<br><br>');
SMTP.AppendBody('Please find the Receivable/Payable Details in PDF Format:');
SMTP.AppendBody('<br><br>');
SMTP.AppendBody('Regards');
SMTP.AppendBody('<br>');
SMTP.AppendBody('Accounts Departments');
//SMTP.AddAttachment(path2,pdf2);
//SMTP.AddAttachment(Path,PdfDocPath);
this is my code i have called this in codeunit and created job queue for automatic email.
Please tell me how to take customer id as filter in my report from form
Thank you