Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Custom action: Use selected report layout from report layouts page for email attachment

(0) ShareShare
ReportReport
Posted on by
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;
 
 
 
 
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 4,858 on at
    Custom action: Use selected report layout from report layouts page for email attachment
    To achieve the described functionality, you can enhance your code to select a specific report layout and use it in the email attachment.

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

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,455 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans