Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Answered

Sending report to customer through .

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 ??

  • 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

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,647 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans