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

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

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

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| IsDuplicateFile | (Integer, Code[20], Option, Integer, Text, Text) | Boolean | public | 17-26 | Pending 24.0 | Replaced with the same procedure with enum instead of option. |
| ShowNotification | (Variant, Integer, Boolean) | - | public | 17-28 | - | - |
| ShowNotFoundPrintableReportsNotification | (Variant) | - | public | 17-28 | - | - |
| ShowDocumentAttachments | (Notification) | - | public | 17-28 | - | - |
| CopyAttachmentsForPostedDocs | (var RecordRef, var RecordRef) | - | public | 19-28 | - | - |
| DeleteAttachedDocuments | (RecordRef) | - | public | 21-28 | - | - |
| SetDocumentAttachmentFiltersForRecRef | (var Record Document Attachment, RecordRef) | - | public | 21-28 | - | - |
| SetDocumentAttachmentFiltersForRecRefInternal | (var Record Document Attachment, RecordRef) | - | internal | 21 | - | - |
| IsSalesDocumentFlow | (Integer) | Boolean | internal | 21-28 | - | - |
| IsPurchaseDocumentFlow | (Integer) | Boolean | internal | 21-28 | - | - |
| IsFlowFieldsEditable | (Integer) | Boolean | internal | 21-28 | - | - |
| TableHasNumberFieldPrimayKey | (Integer, var Integer) | Boolean | internal | 21-28 | - | - |
| TableHasDocTypePrimaryKey | (Integer, var Integer) | Boolean | internal | 21-28 | - | - |
| TableHasLineNumberPrimaryKey | (Integer, var Integer) | Boolean | internal | 21-28 | - | - |
| CopyAttachments | (var RecordRef, var RecordRef) | - | public | 21-28 | - | - |
| DeleteAttachedDocumentsWithConfirm | (RecordRef) | - | public | 22-28 | - | - |
| AttachedDocumentsExist | (RecordRef) | Boolean | public | 22-28 | - | - |
| SetDocumentAttachmentRelatedFiltersForRecRef | (var Record Document Attachment, RecordRef) | - | public | 22-28 | - | - |
| SetDocumentAttachmentFiltersForRecRefInternal | (var Record Document Attachment, RecordRef, Boolean) | - | internal | 22-28 | - | - |
| CopyAttachments | (Variant, Variant) | - | public | 22-28 | - | - |
| CopyAttachmentsForPostedDocsLines | (var RecordRef, var RecordRef) | - | public | 22-28 | - | - |
| MoveAttachmentsWithinSameRecordType | (var RecordRef, var RecordRef) | - | public | 22-28 | - | - |
| ShowDocPrintedToAttachmentNotification | (Variant, Boolean) | - | public | 22-28 | - | - |
| TableHasVATReportConfigCodePrimaryKey | (Integer, var Integer) | Boolean | internal | 23-28 | - | - |
| IsServiceDocumentFlow | (Integer) | Boolean | internal | 24-28 | - | - |
| TransformAttachmentDocumentTypeValue | (Integer, var Enum Attachment Document Type) | - | internal | 24-28 | - | - |
| IsDuplicateFile | (Integer, Code[20], Enum Attachment Document Type, Integer, Text, Text) | Boolean | public | 24-28 | - | - |
| UpdateNumOfRecForFactbox | (var Record Document Attachment, var Integer) | - | internal | 25-28 | - | - |
| GetRefTable | (var RecordRef, Record Document Attachment) | Boolean | public | 25-28 | - | - |
| DeleteAttachedDocuments | (Variant, Boolean) | - | public | 25-28 | - | - |
| IsProductionDocumentFlow | (Integer) | Boolean | internal | 26-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnBeforeCopyAttachmentsForPostedDocsLines | (var RecordRef, var RecordRef, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeDocAttachForPostedPurchaseDocs | (var Record Purchase Header, var Record Purch. Inv. Header, var Record Purch. Cr. Memo Hdr., var Boolean) | 17-26 | - | - |
| Integration event | OnBeforeDocAttachForPostedSalesDocs | (var Record Sales Header, var Record Sales Invoice Header, var Record Sales Cr.Memo Header, var Boolean) | 17-28 | - | - |
| Integration event | OnCopyAttachmentsForPostedDocsOnBeforeToDocumentAttachmentInsert | (var Record Document Attachment, var Record Document Attachment) | 19-28 | - | - |
| Integration event | OnCopyAttachmentsForPostedDocsOnAfterToDocumentAttachmentInsert | (var Record Document Attachment, var Record Document Attachment) | 19-28 | - | - |
| Integration event | OnIsDuplicateFileOnAfterSetFilters | (var Record Document Attachment) | 19-28 | - | - |
| Integration event | OnAfterSetDocumentAttachmentFiltersForRecRef | (var Record Document Attachment, RecordRef) | 20-28 | - | - |
| Integration event | OnBeforeDeleteAttachedDocumentsWithConfirm | (RecordRef, var Boolean) | 20-28 | - | - |
| Integration event | OnAfterTableHasNumberFieldPrimaryKey | (Integer, var Boolean, var Integer) | 22-28 | - | - |
| Integration event | OnAfterTableHasDocTypePrimaryKey | (Integer, var Boolean, var Integer) | 22-28 | - | - |
| Integration event | OnAfterTableHasLineNumberPrimaryKey | (Integer, var Boolean, var Integer) | 22-28 | - | - |
| Integration event | OnAfterSetDocumentAttachmentFiltersForRecRefInternal | (var Record Document Attachment, RecordRef, Boolean) | 22-28 | - | - |
| Integration event | OnSetRelatedAttachmentsFilterOnBeforeSetTableIdFilter | (Integer, var Integer) | 23-28 | - | - |
| Integration event | OnBeforeCopyAttachments | (var RecordRef, var RecordRef, var Boolean) | 24-28 | - | - |
| Integration event | OnAfterGetRefTable | (var RecordRef, Record Document Attachment) | 25-28 | - | - |
| Integration event | OnAfterIsFlowFieldsEditable | (Integer, var Boolean) | 25-28 | - | - |
| Integration event | OnAfterTableIsDocument | (Integer, var Boolean) | 25-28 | - | - |
| Integration event | OnCopyAttachmentsOnAfterSetFromParameters | (RecordRef, var Record Document Attachment, var Enum Attachment Document Type) | 25-28 | - | - |
| Integration event | OnCopyAttachmentsOnAfterSetDocumentFlowFilter | (var Record Document Attachment, RecordRef, RecordRef) | 25-28 | - | - |
| Integration event | OnCopyAttachmentsOnAfterSetToParameters | (var Record Document Attachment, RecordRef, var FieldRef, var Code[20], var Integer, var Enum Attachment Document Type) | 25-28 | - | - |
| Integration event | OnCopyAttachmentsOnAfterSetToDocumentFilters | (var Record Document Attachment, RecordRef, Enum Attachment Document Type, Code[20], Integer) | 25-28 | - | - |
| Integration event | OnAfterTableIsDocumentHeader | (Integer, var Boolean) | 25-28 | - | - |
| Integration event | OnAfterTableIsDocumentLine | (Integer, var Boolean) | 25-28 | - | - |
| Integration event | OnAfterTableIsEntity | (Integer, var Boolean) | 25-28 | - | - |
| Integration event | OnCopyAttachmentsForPostedDocsLinesOnAfterSetFromFilters | (RecordRef, var Record Document Attachment) | 25-28 | - | - |
| Integration event | OnCopyAttachmentsForPostedDocsLinesOnAfterSetToTableID | (RecordRef, var Record Document Attachment) | 25-28 | - | - |
| Integration event | OnAfterTransformAttachmentDocumentTypeValue | (Integer, var Enum Attachment Document Type) | 25-28 | - | - |
| Integration event | OnAfterIsServiceDocumentFlow | (Integer, var Boolean) | 25-28 | - | - |
| Integration event | OnAfterIsProductionDocumentFlow | (Integer, var Boolean) | 26-28 | - | - |
| Integration event | OnBeforeDocAttachForPostedPurchaseDocs | (var Record Purchase Header, var Record Purch. Inv. Header, var Record Purch. Cr. Memo Hdr., var Record Purch. Rcpt. Header, var Boolean) | 27-28 | - | - |
| Integration event | OnMoveAttachmentsWithinSameRecordTypeOnBeforeInsert | (var Record Document Attachment, RecordRef, Code[20]) | 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.
