Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Email Customer Statements as Attachments

Posted on by Microsoft Employee

Looking for a definitive answer to be sure I am not overlooking native functionality.  It doesn't seem possible to handle the creation, attachment and email of statements to all customers in a single process.  I have read a number of posts indicating it is possible through customization and I understand that Microsoft has provided a number of tools to assist but I first want to be sure it isn't possible natively. 

Thanks.

*This post is locked for comments

  • Verified answer
    Marcellus Profile Picture
    Marcellus 2,735 on at
    RE: Email Customer Statements as Attachments

    Hi B Smith,

    When you select the output option email the application will go through Codeunit 8800 Custom Layout Reporting and the RunReportWithCustomReportSelection method in that codeunit.

    There you can see this bit of code:

    // Get the email address of the current object-specific report selection
    EmailAddresses := CustomReportSelection."Send To Email";
    
    CASE OutputType OF
      OutputType::Email:
        IF EmailAddresses <> '' THEN BEGIN
          IF NOT EmailReport(DataRecRef,CustomReportSelection,ReportID) AND (GETLASTERRORTEXT <> '') THEN
    
    ..........................

    So to be able to populate the EmailAddresses variable and get to the EmailReport function, you have to go to the customer card and open the document layouts page:

    DocumentLayoutrec.png

    And add a record for the statement with a send to email address.

    DocumentLayoutrec.png

    I actually just added some code after the "EmailAddresses := CustomReportSelection."Send To Email";" to get the e-mail address from the customer card if the EmailAddresses variable is empty and I can send the statements to the customers via smtp email. I think there is less maintenance if we just use the Email address from the Customer card but maybe you want to send your statements to a specific email address.

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

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans