---
title: "Codeunit 5052 AttachmentManagement"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/
type: codeunit
id: 5052
name: "AttachmentManagement"
app: "Base Application"
namespace: Microsoft.CRM.Interaction
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 5052 AttachmentManagement

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/

| | |
| --- | --- |
| App | Base Application |
| Namespace | Microsoft.CRM.Interaction |
| Versions | 17-28 |
| Source file | CRM/Interaction/AttachmentManagement.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| InsertAttachment | (Integer) | Integer | public | 17-28 | - | - |
| Send | (var Record Delivery Sorter) | - | public | 17-28 | - | - |
| SendUsingExchange | (var Record Delivery Sorter) | - | public | 17-28 | - | - |
| InteractionEMail | (var Record Interaction Log Entry) | Text[80] | public | 17-28 | - | - |
| InteractionFax | (var Record Interaction Log Entry) | Text[30] | public | 17-25 | Pending 23.0 | Fax is not supported anymore. |
| GenerateHTMLContent | (var Record Attachment, Record Segment Line) | Boolean | public | 17-28 | - | - |
| LoadHTMLContent | (var Record Attachment, Record Segment Line) | Text | public | 17-28 | - | - |
| ConvertCorrespondenceType | (Option) | Enum Correspondence Type | public | 17-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterSend | (var Record Delivery Sorter, var Record Delivery Sorter, var Record Delivery Sorter, var Record Delivery Sorter, var Record Interaction Log Entry) | 17-28 | - | - |
| Integration event | OnBeforeDeliverEmailWithAttachment | (var Record Delivery Sorter, var Boolean) | 17-18 | - | - |
| Integration event | OnBeforeDeliverHTMLEmail | (var Record Delivery Sorter, var Record Interaction Log Entry, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeInteractionEMail | (var Record Interaction Log Entry, var Text[80], var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeInteractionFax | (var Record Interaction Log Entry, var Text[30], var Boolean) | 17-25 | Pending 23.0 | Correspondence Type Fax is obsolete and will be removed. |
| Integration event | OnBeforeSend | (var Record Delivery Sorter, var Boolean) | 17-28 | - | - |
| Integration event | OnDeliverEmailWithAttachmentOnBeforeSendEmail | (var Record Delivery Sorter, var Record Interaction Log Entry, Text, Text) | 17-28 | Pending 27.0 | Parameter AttachmentFileFullName and EmailBodyFilePath will be removed |
| Integration event | OnDeliverHTMLEmailOnBeforeSendEmail | (var Record Delivery Sorter, Record Attachment, var Record Interaction Log Entry, Text) | 17-28 | Pending 27.0 | Parameter EmailBodyFilePath will be removed |
| Integration event | OnProcessDeliverySorterHtml | (var Record Delivery Sorter, var Record Delivery Sorter, Record Attachment, Integer) | 17-28 | - | - |
| Integration event | OnProcessDeliverySorterOther | (var Record Delivery Sorter, var Record Delivery Sorter, Record Attachment, Integer) | 17-28 | - | - |
| Integration event | OnProcessDeliverySorterWord | (var Record Delivery Sorter, var Record Delivery Sorter, Record Attachment, Integer) | 17-28 | - | - |
| Integration event | OnConvertCorrespondenceTypeElse | (Option, var Enum Correspondence Type, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeDeliverEmailWithAttachment | (var Record Delivery Sorter, var Boolean, var Record Interaction Log Entry) | 19-28 | - | - |
| Integration event | OnBeforeSetDeliveryState | (var Record Interaction Log Entry, var Boolean) | 21-28 | - | - |
| Integration event | OnSetDeliveryStateOnBeforeModifyInteractLogEntry | (var Record Interaction Log Entry, Boolean) | 23-28 | - | - |
| Integration event | OnBeforeProcessDeliverySorter | (var Record Delivery Sorter, var Record Delivery Sorter, var Record Delivery Sorter, var Record Delivery Sorter, var Boolean) | 23-28 | - | - |
| Integration event | OnInsertAttachmentOnAfterAttachmentInserted | (var Record Attachment, Integer, var Record Attachment, var Boolean) | 23-28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
