web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Sending report to customer through .

(0) ShareShare
ReportReport
Posted on by 782

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

I have the same question (0)
  • Verified answer
    Binesh Profile Picture
    7,887 on at

    Hello,

    Follow the below links, already Saurav Dhyani Posted the article.

    Microsoft Dynamics NAV 2017 - Email From NAV Part 1.

    Microsoft Dynamics NAV 2017 - Email From NAV Part 3.

  • subrata.bauri Profile Picture
    1,144 on at

    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.

  • subrata.bauri Profile Picture
    1,144 on at

    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;

  • Muhammad Arif Maseed Profile Picture
    782 on at

    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 ?

  • Muhammad Arif Maseed Profile Picture
    782 on at

    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 ?

  • subrata.bauri Profile Picture
    1,144 on at

    Variable "Smail" is Codeunit 400 (SMTP Mail)

  • Muhammad Arif Maseed Profile Picture
    782 on at

    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 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans