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

# Table 5062 Attachment

Jonas Paprotka, https://jonas-paprotka.de/ref/table/5062-attachment/

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

## Fields

| Id | Name | Type | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| 1 | No. | Integer | 17-28 | - | - |
| 2 | Attachment File | Blob | 17-28 | - | - |
| 3 | Storage Type | Enum Attachment Storage Type | 17-28 | - | - |
| 4 | Storage Pointer | Text[250] | 17-28 | - | - |
| 5 | File Extension | Text[250] | 17-28 | - | - |
| 6 | Read Only | Boolean | 17-28 | - | - |
| 7 | Last Date Modified | Date | 17-28 | - | - |
| 8 | Last Time Modified | Time | 17-28 | - | - |
| 13 | Merge Source | Blob | 17-28 | - | - |
| 14 | Email Message ID | Blob | 17-28 | - | - |
| 15 | Email Entry ID | Blob | 17-28 | - | - |
| 16 | Email Message Checksum | Integer | 17-28 | - | - |
| 17 | Email Message Url | Blob | 17-28 | - | - |

## Keys

| Name | Fields | Versions |
| --- | --- | --- |
| Key1, clustered | No. | 17-28 |
| Key2 | Email Message Checksum | 17-28 |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| OpenAttachment | (Text[260], Boolean, Code[10]) | - | public | 17-28 | - | - |
| ShowAttachment | (var Record Segment Line, Text[260], Boolean, Boolean) | - | public | 17-21 | Pending 19.0 | Replaced with an overload with two parameters. |
| RunAttachment | (var Record Segment Line, Text[260], Boolean, Boolean, Boolean) | - | public | 17-21 | Pending 19.0 | Replaced with procedure ShowAttachment with two parameters. |
| ExportAttachmentToClientFile | (var Text) | Boolean | public | 17-28 | - | - |
| ImportAttachmentFromClientFile | (Text, Boolean, Boolean) | Boolean | public | 17-28 | - | - |
| ExportAttachmentToServerFile | (var Text) | Boolean | public | 17-28 | - | - |
| ImportAttachmentFromServerFile | (Text, Boolean, Boolean) | Boolean | public | 17-28 | - | - |
| RemoveAttachment | (Boolean) | Boolean | public | 17-28 | - | - |
| WizEmbeddAttachment | (Record Attachment) | - | public | 17-28 | - | - |
| WizSaveAttachment | () | - | public | 17-28 | - | - |
| ConstFilename | () | Text | public | 17-19 | Pending 17.3 | The local file system is not accessible, the procedure FileMgt.ClientTempFileName will always throw an error. This procedure will be removed. |
| ConstDiskFileName | () | Text | public | 17-28 | - | - |
| CheckCorrespondenceType | (Enum Correspondence Type) | Text[80] | public | 17-25 | Pending 23.0 | Correspondence Type Fax is no longer supported. This procedure only checked for Fax. |
| LinkToMessage | (Text, Text, Boolean) | - | public | 17-28 | - | - |
| DisplayInOutlook | () | - | public | 17-24 | - | - |
| Checksum | (Text) | Integer | public | 17-28 | - | - |
| GetMessageID | () | Text | public | 17-28 | - | - |
| SetMessageID | (Text) | - | public | 17-28 | - | - |
| SetEntryID | (Text) | - | public | 17-28 | - | - |
| Read | () | Text | public | 17-28 | - | - |
| Write | (Text) | - | public | 17-28 | - | - |
| ReadHTMLCustomLayoutAttachment | (var Text, var Code[20]) | Boolean | public | 17-28 | - | - |
| WriteHTMLCustomLayoutAttachment | (Text, Code[20]) | - | public | 17-28 | - | - |
| IsHTML | () | Boolean | public | 17-28 | - | - |
| IsHTMLReady | () | Boolean | public | 17-28 | - | - |
| IsHTMLCustomLayout | () | Boolean | public | 17-28 | - | - |
| GetServerFileName | (Text) | Text | public | 17-28 | - | - |
| SetAttachmentFileFromBlob | (Codeunit Temp Blob) | - | public | 17-28 | - | - |
| ShowAttachment | (var Record Segment Line, Text) | - | public | 18-28 | - | - |
| SetAttachmentFileFromStream | (InStream) | - | internal | 18-28 | - | - |
| OpenAttachment | (var Record Segment Line, Text) | - | public | 20-28 | - | - |
| GetEmailMessageUrl | () | Text | public | 20-28 | - | - |
| SetEmailMessageUrl | (Text) | - | public | 20-28 | - | - |
| InsertRecord | () | - | public | 22-28 | - | - |
| ImportAttachmentFromStream | (InStream, Text) | Integer | internal | 22-28 | - | - |
| ReadHTMLCustomLayoutAttachment | (var Text, var Code[20], var Text[250]) | Boolean | public | 23-28 | - | - |
| WriteHTMLCustomLayoutAttachment | (Text, Text[250]) | - | public | 23-28 | - | - |
| ExportAttachmentToTempBlob | (var Codeunit Temp Blob) | Boolean | public | 27-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnBeforeRunAttachment | (var Record Segment Line, Text[260], Boolean, Boolean, Boolean, var Boolean) | 17-22 | Pending 20.0 | Replaced with event OnBeforeShowAttachment. |
| Integration event | OnBeforeExportAttachmentToServerFile | (var Record Attachment, Text, var Boolean, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeImportAttachmentFromServerFile | (var Record Attachment, Text, var Boolean, var Boolean) | 17-26 | - | - |
| Integration event | OnRunAttachmentOnBeforeWordManagementRunMergedDocument | (var Record Attachment, var Boolean) | 17-22 | Pending 20.0 | The event is no longer referenced as the code path calls .Net that is not supported on non-Windows client types. If needed, request a new event in ShowAttachment procedure. |
| Integration event | OnBeforeShowAttachment | (var Record Segment Line, Text, var Boolean) | 18-20 | - | - |
| Integration event | OnAfterCopyAttachmentAsFile | (var Record Attachment, var Record Attachment) | 19-28 | - | - |
| Integration event | OnBeforeShowAttachment | (var Record Segment Line, Text, var Boolean, var Record Attachment) | 21-28 | - | - |
| Integration event | OnShowAttachmentOnAfterCalcAttachmentFile | (var Record Attachment) | 21-28 | - | - |
| Integration event | OnBeforeOpenAttachment | (var Record Attachment, var Text[260], Boolean, Code[10], var Boolean) | 23-28 | - | - |
| Integration event | OnBeforeWizSaveAttachment | (var Record Attachment, var Boolean) | 23-28 | - | - |
| Integration event | OnBeforeWizEmbeddAttachment | (var Record Attachment, Record Attachment, var Boolean) | 23-28 | - | - |
| Integration event | OnBeforeConstDiskFileName | (var Record Attachment, var Text) | 25-28 | - | - |
| Integration event | OnBeforeImportAttachmentFromServerFile | (var Record Attachment, Text, var Boolean, Boolean, Boolean, var Boolean) | 27-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.
