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:
And add a record for the statement with a send to email address.
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.