Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Sending report to customer through .

(0) ShareShare
ReportReport
Posted on by 768

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

  • RE: Sending report to customer through .

    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 

  • subrata.bauri Profile Picture
    subrata.bauri 1,112 on at
    RE: Sending report to customer through .

    Variable "Smail" is Codeunit 400 (SMTP Mail)

  • RE: Sending report to customer through .

    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 ?

  • RE: Sending report to customer through .

    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
    subrata.bauri 1,112 on at
    RE: Sending report to customer through .

    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;

  • subrata.bauri Profile Picture
    subrata.bauri 1,112 on at
    RE: Sending report to customer through .

    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.

  • Verified answer
    Binesh Profile Picture
    Binesh 7,885 on at
    RE: Sending report to customer through .

    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.

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans