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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Replacement for ReportDistributionManagement.SendDocumentReport in recent Business Central

(7) ShareShare
ReportReport
Posted on by 1,981

Hi everyone,

I’m working on upgrading some legacy NAV code to the latest versions of Dynamics 365 Business Central, and I ran into an issue related to document distribution.

In older versions, we used the following internal procedure from Codeunit 452 – ā€œReport Distribution Managementā€:

[Scope('Internal')]

procedure SendDocumentReport(

   var TempDocumentSendingProfile: Record "Document Sending Profile" temporary;

    PostedDocumentVariant: Variant)
 

This procedure handled printing, emailing, saving to disk, and electronic document sending based on the Document Sending Profile.

In newer Business Central versions, this method no longer exists.

However, I still found legacy/custom code calling it like this:

ReportDistributionManagement.SendDocumentReport(
    TempDocumentSendingProfile,
    SalesShipHeader
);
My question What is the modern equivalent of SendDocumentReport in recent Business Central versions?

Any guidance, documentation links, or real-world examples would be much appreciated 🙏

Thanks!

 

I have the same question (0)
  • Suggested answer
    NAV_with_Narang Profile Picture
    2,384 Moderator on at
    Hi There,
     
    If you still haven't been able to get a response it's likely you should reach out to Microsoft Support if you think the issue is product related. Have a nice day!
     
    Thanks
  • Suggested answer
    OussamaSabbouh Profile Picture
    17,676 Super User 2026 Season 1 on at
    Hello,
    there isn’t really a clean one-line replacement for ReportDistributionManagement.SendDocumentReport(...) in modern BC, and the big clue is that the old method was [Scope('Internal')], so it was never meant to be consumed by custom code; in current BC the recommended approach is to refactor based on what you actually need to do: use Document Sending Profiles for the standard user flow like Post and Send / Send by Email, use the modern email setup / document email functionality for emailing PDFs, use normal Report.SaveAs... / report APIs for saving output, and use the newer E-Document framework if you need electronic document sending. So for your upgrade, don’t look for an exact SendDocumentReport equivalent; split the legacy call into the specific channel you need, or reuse the standard posted document send actions where possible.
    Regards,
    Oussama Sabbouh
  • Assisted by AI
    Saif Ali Sabri Profile Picture
    2,691 Moderator on at
    There is no direct one-line replacement for
    ReportDistributionManagement.SendDocumentReport in modern Business Central. The method was always marked [Scope('Internal')] and removed in newer versions. Instead, you now need to refactor based on the specific distribution scenario: use Document Sending Profiles for standard flows, modern email APIs for sending PDFs, Report.SaveAs… methods for saving output, and the E-Document framework for electronic document exchange.

    🔑 Modern Alternatives to SendDocumentReport
    • Document Sending Profiles
      • Still the main user-facing mechanism for ā€œPost and Sendā€ or ā€œSend by Email.ā€
      • Configurable per customer/vendor for print, email, disk, or electronic sending.
    • Email Functionality
      • Use the built-in email setup in BC for sending reports as PDF attachments.
      • Supports SMTP, Exchange, and modern OAuth-based connections.
    • Report.SaveAs Methods
      • Report.SaveAsPdf, Report.SaveAsWord, Report.SaveAsExcel, etc.
      • Ideal for programmatically saving report output to disk or streams.
    • E-Document Framework
      • Introduced for structured electronic document exchange (e.g., PEPPOL).
      • Replace custom ā€œelectronic sendingā€ logic with standardized framework.
    📌 Practical Guidance
    • Refactor legacy calls: Instead of calling SendDocumentReport, break down the requirement:
      • If you need printing/emailing → call the relevant Document Sending Profile actions.
      • If you need saving to disk → use Report.SaveAs… methods.
      • If you need electronic sending → adopt the E-Document framework.
    • Avoid internal methods: The removal signals that Microsoft doesn’t want custom code relying on internal-only procedures.
    • Event-driven extensibility: Use ReportManagement events like OnAfterSubstituteReport if you need to override or redirect reports.
    āš ļø Risks & Considerations
    • Legacy code breaks: Any direct call to SendDocumentReport will fail in modern BC.
    • Migration effort: You must analyze each usage and replace it with the appropriate modern API.
    • Compliance: For electronic documents, using the E-Document framework ensures compliance with EU/PEPPOL standards.
    • Maintainability: Refactoring to supported APIs makes upgrades smoother and avoids breaking changes in future releases.
  • Suggested answer
    Grigorios Mavrogeorgis Profile Picture
    2,544 Super User 2026 Season 1 on at
    Hi,
    the method is not really gone, the whole sending logic got refactored, so SendDocumentReport with that signature was deprecated and the work moved to the Document Sending Profile codeunit itself. Instead of calling Report Distribution Management directly, you now go through the Document Sending Profile, it has a Send method that takes the document record and handles printing, email, disk and electronic the same way the old procedure did, just driven from the profile.
    So for a posted sales shipment your modern path is, get the Document Sending Profile for that customer, or the default, then call its Send passing the shipment header, and it routes everything based on the profile setup. Same outcome, the profile decides the channels, you do not orchestrate them by hand anymore.

    One thing to watch on recent versions, a lot of the service related distribution also got split into separate Serv. codeunits, so if your legacy code touched service docs too check those moved as well. From what I seen the cleanest upgrade is drop the direct codeunit 452 call and lean on the profile's own Send.
     
    Glad to help - follow up if anything is unclear.  
    ā–ŗ  If this solved it, marking it verified helps others too.      
    Regards,
    Grigorios Mavrogeorgis
    Business Central Consultant & AL Developer

    Work: Gmsoft Limited
    Blog:  insidebusinesscentral
    LinkedIn: linkedin.com/in/gregorymavrogeorgis

     
     
  • Gerardo RenterĆ­a GarcĆ­a Profile Picture
    27,280 Most Valuable Professional on at
    Hi
    Which version of nav? Is it standard or was it custom code within that CU?
    Best
    GR

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,081 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,351 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,168 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans