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

auto upload attachments to document attachment

(2) ShareShare
ReportReport
Posted on by 6
I have a requirement which is running a sales order report and then upload that same report to Document attachment table as an attachment automatically.
How to do it?
  • Yael Suarez Profile Picture
    131 on at
    Save the report in Base64 aun Upload into Blob field inside of attachment table
     
  • Suggested answer
    YUN ZHU Profile Picture
    104,157 Super User 2026 Season 2 on at
    I have had similar discussions, and I hope you can refer to the following information.
    Dynamics 365 Business Central: Automatically attaching as PDF to posted sales invoice (Document Attachment)
    Dynamics 365 Business Central: How to copy attachments from Warehouse Receipt to Posted Warehouse Receipt – Customization
     
    Hope this helps.
    Thanks.
    ZHU
     
  • Shathika Karunaratne Profile Picture
    6 on at
    Yael, 
     
    Could you please send a sample code for that if possible?
  • Suggested answer
    YUN ZHU Profile Picture
    104,157 Super User 2026 Season 2 on at
    Hi, if you are referring to printing Sales - Confirmation, I hope the following code can give you some tips.
    pageextension 50132 MyExtension extends "Sales Order"
    {
        actions
        {
            modify("Print Confirmation")
            {
                trigger OnAfterAction()
                var
                    SalesHeader: Record "Sales Header";
                    DocPrint: Codeunit "Document-Print";
                begin
                    SalesHeader := Rec;
                    SalesHeader.SetRecFilter();
                    DocPrint.PrintSalesOrderToDocumentAttachment(SalesHeader, 1);
                end;
            }
        }
    }
    
     
    Thanks
    ZHU

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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 570 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 390 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 220 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans