---
title: "Table 1173 Document Attachment"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/table/1173-document-attachment/
type: table
id: 1173
name: "Document Attachment"
app: "Base Application"
namespace: Microsoft.Foundation.Attachment
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/table/1173-document-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 1173 Document Attachment

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

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

## Fields

| Id | Name | Type | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| 1 | ID | Integer | 17-28 | - | - |
| 2 | Table ID | Integer | 17-28 | - | - |
| 3 | No. | Code[20] | 17-28 | - | - |
| 4 | Attached Date | DateTime | 17-28 | - | - |
| 5 | File Name | Text[250] | 17-28 | - | - |
| 6 | File Type | Enum Document Attachment File Type | 17-28 | - | - |
| 7 | File Extension | Text[30] | 17-28 | - | - |
| 8 | Document Reference ID | Media | 17-28 | - | - |
| 9 | Attached By | Guid | 17-28 | - | - |
| 10 | User | Code[50] | 17-28 | - | - |
| 11 | Document Flow Purchase | Boolean | 17-28 | - | - |
| 12 | Document Flow Sales | Boolean | 17-28 | - | - |
| 13 | Document Type | Enum Attachment Document Type | 17-28 | - | - |
| 14 | Line No. | Integer | 17-28 | - | - |
| 15 | VAT Report Config. Code | Enum VAT Report Configuration | 19-28 | - | - |
| 20 | Document Flow Service | Boolean | 24-28 | - | - |
| 21 | Document Flow Production | Boolean | 26-28 | - | - |

## Keys

| Name | Fields | Versions |
| --- | --- | --- |
| Key1, clustered | Table ID, No., Document Type, Line No., ID | 17-28 |
| Key2 | Document Reference ID | 23-28 |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| Export | (Boolean) | Text | public | 17-28 | - | - |
| HasPostedDocumentAttachment | (Variant) | Boolean | public | 17-28 | - | - |
| SaveAttachment | (RecordRef, Text, Codeunit Temp Blob) | - | public | 17-28 | - | - |
| SaveAttachmentFromStream | (InStream, RecordRef, Text) | - | public | 17-28 | - | - |
| InitFieldsFromRecRef | (RecordRef) | - | public | 17-28 | - | - |
| FindUniqueFileName | (Text, Text) | Text[250] | public | 17-28 | - | - |
| VATReturnSubmissionAttachmentsExist | (Record VAT Report Header) | Boolean | public | 19-28 | - | - |
| VATReturnResponseAttachmentsExist | (Record VAT Report Header) | Boolean | public | 19-28 | - | - |
| DownloadZipFileWithVATReturnSubmissionAttachments | (Enum VAT Report Configuration, Code[20]) | Boolean | public | 19-28 | - | - |
| DownloadZipFileWithVATReturnResponseAttachments | (Enum VAT Report Configuration, Code[20]) | Boolean | public | 19-28 | - | - |
| SaveAttachment | (RecordRef, Text, Codeunit Temp Blob, Boolean) | - | public | 21-28 | - | - |
| SaveAttachmentFromStream | (InStream, RecordRef, Text, Boolean) | - | public | 21-28 | - | - |
| ImportAttachment | (InStream, Text) | - | public | 22-28 | - | - |
| HasContent | () | Boolean | public | 23-28 | - | - |
| ImportFromStream | (InStream, Text) | - | public | 23-28 | - | - |
| ExportToStream | (var OutStream) | - | public | 23-28 | - | - |
| GetAsTempBlob | (var Codeunit Temp Blob) | - | public | 23-28 | - | - |
| GetContentType | () | Text[100] | public | 23-28 | - | - |
| OpenInOneDrive | (Enum Document Sharing Intent) | - | public | 23-28 | - | - |
| SaveAttachment | (List, RecordRef) | - | public | 25-28 | - | - |
| SaveAttachment | (List, RecordRef, TextEncoding) | - | public | 25-28 | - | - |
| SupportedByFileViewer | () | Boolean | public | 26-28 | - | - |
| ViewFile | () | - | public | 26-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnBeforeExportAttachment | (var Record Document Attachment) | 17-28 | - | - |
| Integration event | OnBeforeInsertAttachment | (var Record Document Attachment, var RecordRef) | 17-28 | - | - |
| Integration event | OnBeforeSaveAttachment | (var Record Document Attachment, var RecordRef, Text, var Codeunit Temp Blob) | 17-21 | - | - |
| Integration event | OnBeforeSaveAttachmentFromStream | (var Record Document Attachment, var RecordRef, Text, var InStream) | 17-21 | - | - |
| Integration event | OnAfterInitFieldsFromRecRef | (var Record Document Attachment, var RecordRef) | 18-28 | - | - |
| Integration event | OnBeforeExport | (var Record Document Attachment, var Boolean) | 21 | - | - |
| Integration event | OnBeforeExport | (var Record Document Attachment, var Boolean, Boolean) | 22-28 | - | - |
| Integration event | OnBeforeSaveAttachment | (var Record Document Attachment, var RecordRef, var Text, var Codeunit Temp Blob) | 22-28 | - | - |
| Integration event | OnBeforeSaveAttachmentFromStream | (var Record Document Attachment, var RecordRef, var Text, var InStream) | 22-28 | - | - |
| Integration event | OnBeforeValidateDocumentFlowPurchase | (var Record Document Attachment, Record Document Attachment, Boolean) | 22-23 | - | - |
| Integration event | OnBeforeValidateDocumentFlowSales | (var Record Document Attachment, Record Document Attachment, Boolean) | 22-23 | - | - |
| Integration event | OnInsertOnBeforeCheckDocRefID | (var Record Document Attachment, var Boolean) | 22-28 | - | - |
| Integration event | OnInsertAttachmentOnBeforeImportStream | (var Record Document Attachment, InStream, Text, var Boolean) | 22-28 | - | - |
| Integration event | OnBeforeHasContent | (var Record Document Attachment, var Boolean, var Boolean) | 23-28 | - | - |
| Integration event | OnBeforeImportFromStream | (var Record Document Attachment, var InStream, var Text, var Boolean) | 23-28 | - | - |
| Integration event | OnBeforeExportToStream | (var Record Document Attachment, var OutStream, var Boolean) | 23-28 | - | - |
| Integration event | OnBeforeGetAsTempBlob | (var Record Document Attachment, var Codeunit Temp Blob, var Boolean) | 23-28 | - | - |
| Integration event | OnBeforeOpenInOneDrive | (var Record Document Attachment, Enum Document Sharing Intent, var Boolean) | 23-28 | - | - |
| Integration event | OnBeforeGetContentType | (var Record Document Attachment, var Text[100], var Boolean) | 23-28 | - | - |
| Integration event | OnBeforeValidateDocumentFlowPurchase | (var Record Document Attachment, Record Document Attachment, var Boolean) | 24-28 | - | - |
| Integration event | OnBeforeValidateDocumentFlowSales | (var Record Document Attachment, Record Document Attachment, var Boolean) | 24-28 | - | - |
| Integration event | OnBeforeValidateDocumentFlowService | (var Record Document Attachment, Record Document Attachment, var Boolean) | 24-28 | - | - |
| Integration event | OnAfterIsPostedDocument | (Integer, var Boolean) | 25-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.
