---
id: object/codeunit/452
type: object
title: Codeunit 452 "Report Distribution Management"
summary: Codeunit 452 "Report Distribution Management" in Base Application (Microsoft.Foundation.Reporting). 15 public procedures, 12 events. Present since at least BC23, still in BC30, changed in BC24-28.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "28"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: cb90774a4dc8b53d301655750cc88817982da909197b303c6365268b7b98f49b
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Foundation/Reporting/ReportDistributionManagement.Codeunit.al
    title: src/Layers/W1/BaseApp/Foundation/Reporting/ReportDistributionManagement.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 452
name: Report Distribution Management
namespace: Microsoft.Foundation.Reporting
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 30
  events: 12
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 3
  calls: 7
  called_by: 20
  implements: 0
---

# Codeunit 452 "Report Distribution Management"

> Codeunit 452 "Report Distribution Management" in Base Application (Microsoft.Foundation.Reporting). 15 public procedures, 12 events. Present since at least BC23, still in BC30, changed in BC24-28.

Base Application · Microsoft.Foundation.Reporting · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Foundation/Reporting/ReportDistributionManagement.Codeunit.al) · facts from BC29

## Events published

- `OnBeforeRunDefaultCheckSalesElectronicDocument(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)` (integration)
- `OnBeforeGetBillToCustomer(var Customer: Record Customer; DocumentVariant: Variant; var IsHandled: Boolean)` (integration)
- `OnBeforeGetReportCaption(ReportID: Integer; LanguageCode: Code[10]; var ReportCaption: Text[250]; var IsHandled: Boolean)` (integration)
- `OnBeforeSendXmlEmailAttachment(var ElectronicDocumentFormat: Record "Electronic Document Format"; var Customer: Record Customer; var DocumentSendingProfile: Record "Document Sending Profile")` (integration)
- `OnBeforeVANDocumentReport(HeaderDoc: Variant; var TempDocumentSendingProfile: Record "Document Sending Profile" temporary; var ElectronicDocumentFormat: Record "Electronic Document Format")` (integration)
- `OnAfterGetBillToCustomer(var Customer: Record Customer; DocumentVariant: Variant; DocumentRecordRef: RecordRef)` (integration)
  - subscribers: [Codeunit 6463 "Serv. Report Distribution Mgt."](../codeunit/6463.md) OnAfterGetBillToCustomer
- `OnAfterGetFullDocumentTypeText(DocumentVariant: Variant; var DocumentTypeText: Text[50]; var DocumentRecordRef: RecordRef)` (integration)
- `OnGetDocumentLanguageCodeCaseElse(DocumentRecordRef: RecordRef; var LanguageCode: Code[10])` (integration)
  - subscribers: [Codeunit 6463 "Serv. Report Distribution Mgt."](../codeunit/6463.md) OnGetDocumentLanguageCodeCaseElse
- `OnVANDocumentReportOnBeforeLoopIteration(var RecordRef: RecordRef; var HeaderDoc: Variant)` (integration)
- `OnVANDocumentReportOnBeforeRunDeliveryCodeunit(var RecordExportBuffer: Record "Record Export Buffer")` (integration)
- `OnGetFullDocumentTypeTextElseCase(DocumentRecordRef: RecordRef; var DocumentTypeText: Text[50])` (integration)
  - subscribers: [Codeunit 6463 "Serv. Report Distribution Mgt."](../codeunit/6463.md) OnGetFullDocumentTypeTextElseCase
- `OnGetBillToCustomerOnUnhandledTableNo(DocumentRecordRef: RecordRef; var Customer: Record Customer)` (integration)

## Procedures

- `VANDocumentReport(HeaderDoc: Variant; TempDocumentSendingProfile: Record "Document Sending Profile" temporary)`
- `DownloadPdfOnClient(ServerPdfFilePath: Text): Text`
- `InitializeFrom(NewHideDialog: Boolean)`
- `GetFullDocumentTypeText(DocumentVariant: Variant): Text[50]`
- `GetDocumentLanguageCode(DocumentVariant: Variant): Code[10]`
- `GetReportCaption(ReportID: Integer; LanguageCode: Code[10]): Text[250]`
- `SaveFileOnClient(var TempBlob: Codeunit "Temp Blob"; ClientFileName: Text)`
- `GetIssuedReminderDocTypeTxt(): Text` (internal)
- `SendXmlEmailAttachment(DocumentVariant: Variant; DocumentFormat: Code[20]; ServerEmailBodyFilePath: Text[250]; SendToEmailAddress: Text[250]; ReportUsage: Enum "Report Selection Usage")` (obsolete 27.0: Replaced with SendXmlEmailAttachment that accepts a TempBlob as additional parameter.)
- `SendXmlEmailAttachment(DocumentVariant: Variant; DocumentFormat: Code[20]; var EmailBodyTempBlob: Codeunit "Temp Blob"; SendToEmailAddress: Text[250]; ReportUsage: Enum "Report Selection Usage")`
- `SendXmlEmailAttachmentVendor(DocumentVariant: Variant; DocumentFormat: Code[20]; ServerEmailBodyFilePath: Text[250]; SendToEmailAddress: Text[250])` (obsolete 27.0: Replaced with SendXmlEmailAttachmentVendor that accepts a TempBlob as additional parameter.)
- `SendXmlEmailAttachmentVendor(DocumentVariant: Variant; DocumentFormat: Code[20]; var EmailBodyTempBlob: Codeunit "Temp Blob"; SendToEmailAddress: Text[250])`
- `RunDefaultCheckSalesElectronicDocument(SalesHeader: Record "Sales Header")`
- `GetElectronicDocumentFormat(var ElectronicDocumentFormat: Record "Electronic Document Format"; DocumentVariant: Variant)`
- `CreateOrAppendZipFile(var DataCompression: Codeunit "Data Compression"; var ServerTempBlob: Codeunit "Temp Blob"; ClientFileName: Text[250]; var ClientZipFileName: Text[250])`

Plus 3 local procedures.

## Triggers

OnRun

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 419 "File Management"](../codeunit/419.md) (4 calls: `CreateOrAppendZipFile → GetFileNameWithoutExtension`, `DownloadPdfOnClient → DownloadTempFile`, `SaveFileOnClient → BLOBExport`, …)
- [Codeunit 425 "Data Compression"](../codeunit/425.md) (4 calls: `CreateOrAppendZipFile → AddEntry`, `CreateOrAppendZipFile → CreateZipArchive`, `CreateOrAppendZipFile → IsGZip`, …)
- [Codeunit 53 "Translation Helper"](../codeunit/53.md) (4 calls: `GetFullDocumentTypeText → RestoreGlobalLanguage`, `GetFullDocumentTypeText → SetGlobalLanguageByCode`, `GetReportCaption → RestoreGlobalLanguage`, …)
- [Codeunit 260 "Document-Mailing"](../codeunit/260.md) (3 calls: `SendAttachment → EmailFile`, `SendXmlEmailAttachment → GetToAddressFromCustomer`, `SendXmlEmailAttachmentVendor → GetToAddressFromVendor`)
- [Codeunit 4100 "Temp Blob"](../codeunit/4100.md) (3 calls: `CreateOrAppendZipFile → CreateInStream`, `SendAttachment → CreateInStream`, `SendAttachment → HasValue`)
- [Codeunit 1306 "Company Information Mgt."](../codeunit/1306.md) (1 call: `GetDocumentLanguageCode → GetLanguageDefault`)
- [Codeunit 1410 "Doc. Exch. Service Mgt."](../codeunit/1410.md) (1 call: `VANDocumentReport → SendDocument`)

## Called by

- [Table 60 "Document Sending Profile"](../table/60.md) (10 calls: `SendToDisk → CreateOrAppendZipFile`, `SendToDisk → SaveFileOnClient`, `SendToDiskVendor → CreateOrAppendZipFile`, …)
- [Table 112 "Sales Invoice Header"](../table/112.md) (4 calls: `EmailRecords → GetFullDocumentTypeText`, `GetDocTypeTxt → GetFullDocumentTypeText`, `SendProfile → GetFullDocumentTypeText`, …)
- [Table 110 "Sales Shipment Header"](../table/110.md) (3 calls: `EmailRecords → GetFullDocumentTypeText`, `SendProfile → GetFullDocumentTypeText`, `SendRecords → GetFullDocumentTypeText`)
- [Table 114 "Sales Cr.Memo Header"](../table/114.md) (3 calls: `EmailRecords → GetFullDocumentTypeText`, `SendProfile → GetFullDocumentTypeText`, `SendRecords → GetFullDocumentTypeText`)
- [Table 167 "Job"](../table/167.md) (3 calls: `EmailRecords → GetFullDocumentTypeText`, `SendProfile → GetFullDocumentTypeText`, `SendRecords → GetFullDocumentTypeText`)
- [Table 38 "Purchase Header"](../table/38.md) (2 calls: `GetDocTypeTxt → GetFullDocumentTypeText`, `GetReportSelectionsUsageFromDocumentType → GetFullDocumentTypeText`)
- [Table 5992 "Service Invoice Header"](../table/5992.md) (2 calls: `SendProfile → GetFullDocumentTypeText`, `SendRecords → GetFullDocumentTypeText`)
- [Table 5994 "Service Cr.Memo Header"](../table/5994.md) (2 calls: `SendProfile → GetFullDocumentTypeText`, `SendRecords → GetFullDocumentTypeText`)
- [Table 6660 "Return Receipt Header"](../table/6660.md) (2 calls: `EmailRecords → GetFullDocumentTypeText`, `SendRecords → GetFullDocumentTypeText`)
- [Table 77 "Report Selections"](../table/77.md) (2 calls: `SaveDocumentAttachmentFromRecRef → GetDocumentLanguageCode`, `SaveDocumentAttachmentFromRecRef → GetReportCaption`)
- [Codeunit 1890 "Reminder Communication"](../codeunit/1890.md) (1 call: `OnBeforeGetEmailSubject → GetIssuedReminderDocTypeTxt`)
- [Codeunit 6463 "Serv. Report Distribution Mgt."](../codeunit/6463.md) (1 call: `RunDefaultCheckServiceElectronicDocument → GetElectronicDocumentFormat`)
- [Codeunit 6753 "Send Reminder Event Handler"](../codeunit/6753.md) (1 call: `AttachDocument → GetFullDocumentTypeText`)
- [Codeunit 6762 "Reminder-Send"](../codeunit/6762.md) (1 call: `SendReminderImplementation → GetFullDocumentTypeText`)
- [Codeunit 80 "Sales-Post"](../codeunit/80.md) (1 call: `CheckSalesDocument → RunDefaultCheckSalesElectronicDocument`)
- [Table 1001 "Job Task"](../table/1001.md) (1 call: `SendProfile → GetFullDocumentTypeText`)
- [Table 297 "Issued Reminder Header"](../table/297.md) (1 call: `PrintRecords → GetFullDocumentTypeText`)
- [Table 304 "Issued Fin. Charge Memo Header"](../table/304.md) (1 call: `PrintRecords → GetFullDocumentTypeText`)
- [Table 36 "Sales Header"](../table/36.md) (1 call: `GetDocTypeTxt → GetFullDocumentTypeText`)
- [Table 61 "Electronic Document Format"](../table/61.md) (1 call: `GetDocumentType → GetDocumentLanguageCode`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-28

## Deprecations

- procedure SendXmlEmailAttachment: Pending 27.0 (#if not CLEAN27), "Replaced with SendXmlEmailAttachment that accepts a TempBlob as additional parameter."
- procedure SendXmlEmailAttachmentVendor: Pending 27.0 (#if not CLEAN27), "Replaced with SendXmlEmailAttachmentVendor that accepts a TempBlob as additional parameter."

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Report Distribution Management")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
