---
title: "Codeunit 5052 AttachmentManagement, extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/points/
object: https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/
app: "Base Application"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 5052 AttachmentManagement, extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/points/

25 procedures and triggers with a step in src/Layers/W1/BaseApp/CRM/Interaction/AttachmentManagement.Codeunit.al, in source order, read from the text, not from a run.

## InsertAttachment

[Line 35](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L35).

- [48](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L48) writes [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) Insert(true)
- [51](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L51) raises `OnInsertAttachmentOnAfterAttachmentInserted`, IsHandled
- [57](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L57) calls `TransferAttachment`

## Send

[Line 63](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L63).

- [72](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L72) raises `OnBeforeSend`, IsHandled
- [75](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L75) calls `ProcessDeliverySorter`
- [78](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L78) calls [Codeunit 5069 Word Template Interactions](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/) `Merge`
- [81](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L81) calls `DeliverHTMLEmail`
- [84](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L84) calls `DeliverEmailWithAttachment`
- [86](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L86) raises `OnAfterSend`

## SendUsingExchange

[Line 92](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L92).

- [101](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L101) calls `ProcessDeliverySorter`
- [104](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L104) calls [Codeunit 5069 Word Template Interactions](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/) `Merge`
- [106](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L106) calls `InitializeExchange`
- [108](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L108) calls `DeliverHTMLEmailViaExchange`
- [111](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L111) calls `DeliverEmailWithAttachmentViaExchange`

## TransferAttachment

[Line 114](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L114), local.

- [124](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L124) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ConstDiskFileName`
- [125](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L125) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ExportAttachmentToServerFile`
- [130](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L130) writes [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) Modify
- [140](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L140) writes [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) Modify
- [141](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L141) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ConstDiskFileName`
- [141](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L141) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ConstDiskFileName`
- [148](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L148) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ImportAttachmentFromServerFile`
- [148](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L148) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ConstDiskFileName`
- [151](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L151) writes [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) Modify

## InteractionEMail

[Line 155](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L155).

- [161](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L161) raises `OnBeforeInteractionEMail`, IsHandled

## GenerateHTMLContent

[Line 178](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L178).

- [180](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L180) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `IsHTML`
- [183](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L183) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `IsHTMLReady`
- [186](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L186) calls `GenerateHTMLReadyAttachmentFromCustomLayout`

## LoadHTMLContent

[Line 190](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L190).

- [192](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L192) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `IsHTML`
- [195](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L195) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `IsHTMLReady`
- [196](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L196) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `Read`
- [198](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L198) calls `LoadHTMLContentFromCustomLayoutAttachment`

## LoadHTMLContentFromCustomLayoutAttachment

[Line 201](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L201), local.

- [207](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L207) calls `GenerateHTMLReadyContentFromCustomLayoutAttachment`
- [212](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L212) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ImportAttachmentFromServerFile`
- [214](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L214) writes [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) Insert
- [215](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L215) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `Read`
- [216](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L216) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `RemoveAttachment`

## GenerateHTMLReadyAttachmentFromCustomLayout

[Line 219](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L219), local.

- [223](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L223) calls `GenerateHTMLReadyContentFromCustomLayoutAttachment`
- [227](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L227) writes [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) Delete
- [229](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L229) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ImportAttachmentFromServerFile`
- [231](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L231) writes [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) Insert

## GenerateHTMLReadyContentFromCustomLayoutAttachment

[Line 236](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L236), local.

- [246](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L246) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `ServerTempFileName`
- [250](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L250) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ReadHTMLCustomLayoutAttachment`
- [252](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L252) calls [Table 9651 Report Layout Selection](https://jonas-paprotka.de/ref/table/9651-report-layout-selection/) `SetTempLayoutSelectedName`
- [254](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L254) calls [Table 9651 Report Layout Selection](https://jonas-paprotka.de/ref/table/9651-report-layout-selection/) `SetTempLayoutSelected`
- [255](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L255) calls [Report 5084 Email Merge](https://jonas-paprotka.de/ref/report/5084-email-merge/) `InitializeRequest`
- [256](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L256) calls [Report 5084 Email Merge](https://jonas-paprotka.de/ref/report/5084-email-merge/) `SaveAsHtml`
- [257](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L257) calls [Table 9651 Report Layout Selection](https://jonas-paprotka.de/ref/table/9651-report-layout-selection/) `ClearTempLayoutSelected`

## InitializeExchange

[Line 260](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L260), local.

- [266](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L266) calls `InitializeExchangeWithToken`

## InitializeExchangeWithToken

[Line 271](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L271), local.

- [277](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L277) calls [Codeunit 6300 Azure AD Mgt.](https://jonas-paprotka.de/ref/codeunit/6300-azure-ad-mgt/) `GetAccessTokenAsSecretText`
- [277](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L277) calls [Codeunit 6300 Azure AD Mgt.](https://jonas-paprotka.de/ref/codeunit/6300-azure-ad-mgt/) `GetO365Resource`
- [277](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L277) calls [Codeunit 6300 Azure AD Mgt.](https://jonas-paprotka.de/ref/codeunit/6300-azure-ad-mgt/) `GetO365ResourceName`
- [280](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L280) calls [Codeunit 5321 Exchange Web Services Server](https://jonas-paprotka.de/ref/codeunit/5321-exchange-web-services-server/) `InitializeWithOAuthToken`
- [280](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L280) calls [Codeunit 5321 Exchange Web Services Server](https://jonas-paprotka.de/ref/codeunit/5321-exchange-web-services-server/) `GetEndpoint`
- [286](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L286) calls [Codeunit 5321 Exchange Web Services Server](https://jonas-paprotka.de/ref/codeunit/5321-exchange-web-services-server/) `InitializeWithCertificate`
- [291](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L291) calls [Codeunit 5321 Exchange Web Services Server](https://jonas-paprotka.de/ref/codeunit/5321-exchange-web-services-server/) `SetImpersonatedIdentity`

## DeliverHTMLEmail

[Line 302](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L302), local.

- [308](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L308) raises `OnBeforeDeliverHTMLEmail`, IsHandled
- [317](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L317) calls `GetAttachment`
- [319](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L319) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ExportAttachmentToTempBlob`
- [321](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L321) raises `OnDeliverHTMLEmailOnBeforeSendEmail`
- [323](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L323) raises `OnDeliverHTMLEmailOnBeforeSendEmail`
- [326](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L326) calls `SendHTMLEmail`
- [328](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L328) calls `SetDeliveryState`

## DeliverHTMLEmailViaExchange

[Line 332](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L332), local.

- [343](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L343) calls `GetAttachment`
- [344](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L344) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `ServerTempFileName`
- [345](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L345) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ExportAttachmentToServerFile`
- [348](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L348) calls `SendHTMLEmailViaExchange`
- [351](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L351) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `DeleteServerFile`
- [353](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L353) calls `SetDeliveryState`

## DeliverEmailWithAttachment

[Line 357](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L357), local.

- [364](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L364) raises `OnBeforeDeliverEmailWithAttachment`, IsHandled
- [372](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L372) calls `GetAttachment`
- [374](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L374) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ExportAttachmentToTempBlob`
- [376](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L376) calls `PrepareDummyEmailBody`
- [378](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L378) raises `OnDeliverEmailWithAttachmentOnBeforeSendEmail`
- [380](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L380) raises `OnDeliverEmailWithAttachmentOnBeforeSendEmail`
- [382](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L382) calls `SendEmailWithAttachment`
- [384](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L384) calls `SetDeliveryState`

## DeliverEmailWithAttachmentViaExchange

[Line 388](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L388), local.

- [412](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L412) calls `PrepareServerAttachment`
- [417](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L417) calls `SendEmailWithAttachmentViaExchange`
- [420](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L420) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `DeleteServerFile`
- [422](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L422) calls `SetDeliveryState`

## SendHTMLEmail

[Line 429](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L429), local.

- [439](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L439) calls [Codeunit 4100 Temp Blob](https://jonas-paprotka.de/ref/codeunit/4100-temp-blob/) `CreateInStream`
- [451](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L451) calls [Codeunit 260 Document-Mailing](https://jonas-paprotka.de/ref/codeunit/260-document-mailing/) `EmailFile`
- [453](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L453) calls `InteractionEMail`
- [455](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L455) calls `SetDeliveryState`

## SendHTMLEmailViaExchange

[Line 458](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L458), local.

- [463](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L463) calls [Codeunit 5321 Exchange Web Services Server](https://jonas-paprotka.de/ref/codeunit/5321-exchange-web-services-server/) `SendEmailMessageWithAttachment`
- [464](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L464) calls `InteractionEMail`
- [465](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L465) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `Read`
- [465](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L465) calls `GetSenderSalesPersonEmail`
- [467](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L467) calls `SetDeliveryState`

## SendEmailWithAttachment

[Line 470](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L470), local.

- [479](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L479) calls [Codeunit 4100 Temp Blob](https://jonas-paprotka.de/ref/codeunit/4100-temp-blob/) `HasValue`
- [480](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L480) calls [Codeunit 4100 Temp Blob](https://jonas-paprotka.de/ref/codeunit/4100-temp-blob/) `CreateInStream`
- [492](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L492) calls [Codeunit 260 Document-Mailing](https://jonas-paprotka.de/ref/codeunit/260-document-mailing/) `EmailFile`
- [493](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L493) calls `GetAttachmentFileDefaultName`
- [494](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L494) calls `InteractionEMail`
- [496](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L496) calls `SetDeliveryState`

## SendEmailWithAttachmentViaExchange

[Line 499](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L499), local.

- [504](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L504) calls [Codeunit 5321 Exchange Web Services Server](https://jonas-paprotka.de/ref/codeunit/5321-exchange-web-services-server/) `SendEmailMessageWithAttachment`
- [505](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L505) calls `InteractionEMail`
- [506](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L506) calls `GetSenderSalesPersonEmail`
- [507](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L507) calls `SetDeliveryState`

## PrepareServerAttachment

[Line 510](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L510), local.

- [517](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L517) calls `GetAttachment`
- [518](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L518) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `ServerTempFileName`
- [519](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L519) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ExportAttachmentToServerFile`
- [520](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L520) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `CombinePath`
- [521](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L521) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `GetDirectoryName`
- [522](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L522) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `CopyServerFile`
- [523](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L523) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `DeleteServerFile`

## SetDeliveryState

[Line 527](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L527), local.

- [529](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L529) raises `OnBeforeSetDeliveryState`
- [534](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L534) raises `OnSetDeliveryStateOnBeforeModifyInteractLogEntry`
- [535](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L535) writes [Table 5065 Interaction Log Entry](https://jonas-paprotka.de/ref/table/5065-interaction-log-entry/) Modify

## ProcessDeliverySorter

[Line 539](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L539), local.

- [549](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L549) raises `OnBeforeProcessDeliverySorter`, IsHandled
- [572](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L572) writes [Table 5074 Delivery Sorter](https://jonas-paprotka.de/ref/table/5074-delivery-sorter/) Insert
- [577](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L577) raises `OnProcessDeliverySorterHtml`
- [578](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L578) writes [Table 5074 Delivery Sorter](https://jonas-paprotka.de/ref/table/5074-delivery-sorter/) Insert
- [580](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L580) calls [Codeunit 5069 Word Template Interactions](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/) `IsWordDocumentExtension`
- [583](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L583) raises `OnProcessDeliverySorterWord`
- [584](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L584) writes [Table 5074 Delivery Sorter](https://jonas-paprotka.de/ref/table/5074-delivery-sorter/) Insert
- [588](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L588) raises `OnProcessDeliverySorterOther`
- [589](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L589) writes [Table 5074 Delivery Sorter](https://jonas-paprotka.de/ref/table/5074-delivery-sorter/) Insert

## PrepareDummyEmailBody

[Line 607](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L607), local.

- [612](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L612) calls [Codeunit 4100 Temp Blob](https://jonas-paprotka.de/ref/codeunit/4100-temp-blob/) `CreateOutStream`

## ConvertCorrespondenceType

[Line 624](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L624).

- [634](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/#L634) raises `OnConvertCorrespondenceTypeElse`, IsHandled

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
