Hi everyone,
I'm working on a customization for the Posted Sales Invoice page. My goal is to add a new email action called "Email Custom Layout" that,
1. Opens the report layout page, filtered to show only the layouts related to the Posted Sales Invoice.
2. Allows the user to select a layout
3. The selected layout should show up on the email editor page as an attachment instead of the default layout.
Basically, this should run the same way as the native email action but with the addition of the user selected layout part. The customer wants to run different layouts than the default layout.
Is there a way to use the selected layout for the email attachment instead of the default one?
Here's the relevant portion of my current code:
ReportLayoutList.SetRange("Report ID", Report::"Standard Sales - Invoice");
if Page.RunModal(Page::"Report Layouts", ReportLayoutList) = ACTION::LookupOK then begin
SalesInvHeader := Rec;
CurrPage.SetSelectionFilter(SalesInvHeader);
SalesInvHeader.EmailRecords(true);
end;