Announcements
Hi Experts,
I have created a custom document page i added action to generate invoice for this page and send custom report to customer.
Action Name ( Generate Invoice).
I want to perform two function on this action.
1 To Generate invoice ( 1st function are completed and its generate invoice).
2. Send custom report to customer.
Now i am trying when i click on action "Generate Invoice" it will generate invoice (Invoice are generating ) and send my custom report to the customer.
how to send custom report to customer ??
*This post is locked for comments
sir this is working perfectly for nav but not for business central can you please do 1 example to send report through email in AL for business central
Variable "Smail" is Codeunit 400 (SMTP Mail)
Dear SUBARATA BAURI
can you please explain the variables which you used eg (Smail). what is Smail if it is variable then it link with witch record ?
Dear SUBARATA BAURI
can you please explain the variables which you used eg (Smail). what is Smail if it is variable then it link with witch record ?
Code..
REPORT.SAVEASPDF(REPORT::"Customer Ledger", FileName, Customer);
Tofile := Rrt.DownloadToClientFileName(FileName, Tofile);
SMTP.GET;
CLEAR(Smail);
Smail.CreateMessage(CompInfo.Name,SMTP."User ID",Customer."E-Mail",'Statement','Dear Sir,',TRUE);
Smail.AddAttachment(FileName,'');
Smail.Send;
First of all you have to save report output as PDF file and then Call two functions 1. CreateMessage & 2. AddAttachment from Codeunit 'SMTP Mail' to mail the report to customer.
Hello,
Follow the below links, already Saurav Dhyani Posted the article.
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156