web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Combine Pdf for Email

(0) ShareShare
ReportReport
Posted on by 666

I created my own email button for BC. 
I can email my report by using the  DocumentSendingProfile.TrySendToEMail() procedure. The problem I have is when there is 2 or more items in the same order I receive an email for each item. I want all the Items for the one order to be on one report and sent as one email. 

pastedimage1631170751781v1.png

pastedimage1631170782493v2.png


Settings I have implemented.

 1. Document Sending Profile  - Combine PDF Document: True,    Email Attachment: PDF
 2. Assigned my Document Sendiing profile to my Customer

 3.  In the Code 

 DocumentSendingProfile."Combine Email Documents" := true;
 
Sometimes it does send the report by order and not by Item. but its not consistent
  • Suggested answer
    Hein Kruger Profile Picture
    666 on at

    I Found my problem.

    lets use a sales order with three items as an example.

    Before sending the email I set the range for the Record to filter to the Source No. Which will filter to the three items.

    in the TrySendEmail, we have RecordVariant: Variant and DocumentNoFieldNo: Integer as part of the parameters.

    The RecordVariant sends all the records while the DocumentNoFieldNo does the group by.

    In my first case the DocumentNoFieldNo was set to Line No. which is why we got three emails. I set it to Source No. and the problem was resolved

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 743 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 546 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 332 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans