---
id: object/codeunit/1173
type: object
title: Codeunit 1173 "Document Attachment Mgmt"
summary: Codeunit 1173 "Document Attachment Mgmt" in Base Application (Microsoft.Foundation.Attachment). 31 public procedures, 31 events, 50 event subscribers. Present since at least BC23, still in BC30, changed in BC24-27, BC29.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "29"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 123e5bd6b01699fd8528440c076e981a151a0a5828a458d2a0146d9c3413527c
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Foundation/Attachment/DocumentAttachmentMgmt.Codeunit.al
    title: src/Layers/W1/BaseApp/Foundation/Attachment/DocumentAttachmentMgmt.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/11342
    - change/bcapps/11114
object_type: codeunit
object_id: 1173
name: Document Attachment Mgmt
namespace: Microsoft.Foundation.Attachment
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "26"
  - "27"
  - "29"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 121
  events: 31
  subscribers: 50
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 48
  calls: 3
  called_by: 17
  implements: 0
---

# Codeunit 1173 "Document Attachment Mgmt"

> Codeunit 1173 "Document Attachment Mgmt" in Base Application (Microsoft.Foundation.Attachment). 31 public procedures, 31 events, 50 event subscribers. Present since at least BC23, still in BC30, changed in BC24-27, BC29.

Base Application · Microsoft.Foundation.Attachment · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Foundation/Attachment/DocumentAttachmentMgmt.Codeunit.al) · facts from BC29

## Events published

- `OnAfterSetDocumentAttachmentFiltersForRecRef(var DocumentAttachment: Record "Document Attachment"; RecRef: RecordRef)` (integration)
  - subscribers: [Codeunit 20414 "Qlty. Attachment Integration"](../codeunit/20414.md) HandleOnAfterSetDocumentAttachmentFiltersForRecRef, [Codeunit 6169 "E-Doc. Attachment Processor"](../codeunit/6169.md) OnAfterSetDocumentAttachmentFiltersForRecRef
- `OnBeforeCopyAttachmentsForPostedDocsLines(var FromRecRef: RecordRef; var ToRecRef: RecordRef; var IsHandled: Boolean)` (integration)
- `OnBeforeSetDocumentTypeForPostedDocument(var DocumentAttachment: Record "Document Attachment"; PostedDocumentTableID: Integer; var IsHandled: Boolean)` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnBeforeSetDocumentTypeForPostedDocument
- `OnBeforeDeleteAttachedDocumentsWithConfirm(RecRef: RecordRef; var IsHandled: Boolean)` (integration)
- `OnBeforeDocAttachForPostedPurchaseDocs(var PurchaseHeader: Record "Purchase Header"; var PurchInvHeader: Record "Purch. Inv. Header"; var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; var PurchRcptHeader: Record "Purch. Rcpt. Header"; var IsHandled: Boolean)` (integration)
- `OnBeforeDocAttachForPostedSalesDocs(var SalesHeader: Record "Sales Header"; var SalesInvoiceHeader: Record "Sales Invoice Header"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var IsHandled: Boolean)` (integration)
  - subscribers: [Codeunit 8001 "Sub. Contr. Renewal Subcribers"](../codeunit/8001.md) SkipDocumentAttachmentForContractRenewalLines
- `OnCopyAttachmentsForPostedDocsOnBeforeToDocumentAttachmentInsert(var FromDocumentAttachment: Record "Document Attachment"; var ToDocumentAttachment: Record "Document Attachment")` (integration)
- `OnCopyAttachmentsForPostedDocsOnAfterToDocumentAttachmentInsert(var FromDocumentAttachment: Record "Document Attachment"; var ToDocumentAttachment: Record "Document Attachment")` (integration)
- `OnIsDuplicateFileOnAfterSetFilters(var DocumentAttachment: Record "Document Attachment")` (integration)
- `OnAfterTableHasNumberFieldPrimaryKey(TableNo: Integer; var Result: Boolean; var FieldNo: Integer)` (integration)
  - subscribers: [Codeunit 20414 "Qlty. Attachment Integration"](../codeunit/20414.md) HandleOnAfterTableHasNumberFieldPrimaryKey, [Codeunit 6169 "E-Doc. Attachment Processor"](../codeunit/6169.md) OnAfterTableHasNumberFieldPrimaryKeyForEDocs, [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnAfterTableHasNumberFieldPrimaryKey, [Codeunit 6989 "Expense Attachment Mgt."](../codeunit/6989.md) OnAfterTableHasNumberFieldPrimaryKey, [Codeunit 99000783 "Prod. Document Attachment Mgt."](../codeunit/99000783.md) OnAfterTableHasNumberFieldPrimaryKey
- `OnAfterTableHasDocTypePrimaryKey(TableNo: Integer; var Result: Boolean; var FieldNo: Integer)` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnAfterTableHasDocTypePrimaryKey, [Codeunit 99000783 "Prod. Document Attachment Mgt."](../codeunit/99000783.md) OnAfterTableHasDocTypePrimaryKey
- `OnAfterTableHasLineNumberPrimaryKey(TableNo: Integer; var Result: Boolean; var FieldNo: Integer)` (integration)
  - subscribers: [Codeunit 20414 "Qlty. Attachment Integration"](../codeunit/20414.md) HandleOnAfterTableHasLineNumberPrimaryKey, [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnAfterTableHasLineNumberPrimaryKey, [Codeunit 6989 "Expense Attachment Mgt."](../codeunit/6989.md) OnAfterTableHasLineNumberPrimaryKey, [Codeunit 99000783 "Prod. Document Attachment Mgt."](../codeunit/99000783.md) OnAfterTableHasLineNumberPrimaryKey
- `OnAfterSetDocumentAttachmentFiltersForRecRefInternal(var DocumentAttachment: Record "Document Attachment"; RecordRef: RecordRef; GetRelatedAttachments: Boolean)` (integration)
  - subscribers: [Codeunit 6989 "Expense Attachment Mgt."](../codeunit/6989.md) OnAfterSetDocumentAttachmentFiltersForRecRefInternal
- `OnSetRelatedAttachmentsFilterOnBeforeSetTableIdFilter(TableNo: Integer; var RelatedTable: Integer)` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnSetRelatedAttachmentsFilterOnBeforeSetTableIdFilter
- `OnBeforeCopyAttachments(var FromRecRef: RecordRef; var ToRecRef: RecordRef; var Handled: Boolean)` (integration)
- `OnAfterGetRefTable(var RecRef: RecordRef; DocumentAttachment: Record "Document Attachment")` (integration)
  - subscribers: [Codeunit 20414 "Qlty. Attachment Integration"](../codeunit/20414.md) HandleOnAfterGetRefTable, [Codeunit 6169 "E-Doc. Attachment Processor"](../codeunit/6169.md) OnAfterGetRefTableForEDocs, [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnAfterGetRefTable, [Codeunit 6989 "Expense Attachment Mgt."](../codeunit/6989.md) OnAfterGetRefTable, [Codeunit 8059 "Sub. Contracts General Mgt."](../codeunit/8059.md) SetServiceObjectAsRecRef, [Codeunit 99000783 "Prod. Document Attachment Mgt."](../codeunit/99000783.md) OnAfterGetRefTable
- `OnAfterIsFlowFieldsEditable(TableNo: Integer; var Editable: Boolean)` (integration)
  - subscribers: [Codeunit 20578 "Subc. Attachment Details Ext."](../codeunit/20578.md) OnAfterIsFlowFieldsEditable
- `OnAfterTableIsDocument(TableNo: Integer; var IsDocument: Boolean)` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnAfterIsTableDocument, [Codeunit 99000783 "Prod. Document Attachment Mgt."](../codeunit/99000783.md) OnAfterIsTableDocument
- `OnCopyAttachmentsOnAfterSetFromParameters(FromRecRef: RecordRef; var FromDocumentAttachment: Record "Document Attachment"; var FromAttachmentDocumentType: Enum "Attachment Document Type")` (integration)
  - subscribers: [Codeunit 6169 "E-Doc. Attachment Processor"](../codeunit/6169.md) OnCopyAttachmentsOnAfterSetFromParameters, [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnCopyAttachmentsOnAfterSetFromParameters, [Codeunit 6989 "Expense Attachment Mgt."](../codeunit/6989.md) OnCopyAttachmentsOnAfterSetFromParameters, [Codeunit 99000783 "Prod. Document Attachment Mgt."](../codeunit/99000783.md) OnCopyAttachmentsOnAfterSetFromParameters
- `OnCopyAttachmentsOnAfterSetDocumentFlowFilter(var FromDocumentAttachment: Record "Document Attachment"; FromRecRef: RecordRef; ToRecRef: RecordRef)` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnCopyAttachmentsOnAfterSetDocumentFlowFilter, [Codeunit 99000783 "Prod. Document Attachment Mgt."](../codeunit/99000783.md) OnCopyAttachmentsOnAfterSetDocumentFlowFilter
- `OnCopyAttachmentsOnAfterSetToParameters(var ToDocumentAttachment: Record "Document Attachment"; ToRecRef: RecordRef; var ToFieldRef: FieldRef; var ToNo: Code[20]; var ToLineNo: Integer; var ToAttachmentDocumentType: Enum "Attachment Document Type")` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnCopyAttachmentsOnAfterSetToParameters, [Codeunit 6989 "Expense Attachment Mgt."](../codeunit/6989.md) OnCopyAttachmentsOnAfterSetToParameters, [Codeunit 99000783 "Prod. Document Attachment Mgt."](../codeunit/99000783.md) OnCopyAttachmentsOnAfterSetToParameters
- `OnCopyAttachmentsOnAfterSetToDocumentFilters(var ToDocumentAttachment: Record "Document Attachment"; ToRecRef: RecordRef; ToAttachmentDocumentType: Enum "Attachment Document Type"; ToNo: Code[20]; ToLineNo: Integer)` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnCopyAttachmentsOnAfterSetToDocumentFilters, [Codeunit 6989 "Expense Attachment Mgt."](../codeunit/6989.md) OnCopyAttachmentsOnAfterSetToDocumentFilters, [Codeunit 8751 "DA External Storage Impl."](../codeunit/8751.md) Document Attachment Mgmt_OnCopyAttachmentsOnAfterSetToDocumentFilters, [Codeunit 99000783 "Prod. Document Attachment Mgt."](../codeunit/99000783.md) OnCopyAttachmentsOnAfterSetToDocumentFilters
- `OnAfterTableIsDocumentHeader(TableNo: Integer; var IsHeader: Boolean)` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnAfterTableIsDocumentHeader
- `OnAfterTableIsDocumentLine(TableNo: Integer; var IsLine: Boolean)` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnAfterTableIsDocumentLine
- `OnAfterTableIsEntity(TableNo: Integer; var IsEntity: Boolean)` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnAfterTableIsEntity
- `OnCopyAttachmentsForPostedDocsLinesOnAfterSetFromFilters(FromRecRef: RecordRef; var FromDocumentAttachmentLine: Record "Document Attachment")` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnCopyAttachmentsForPostedDocsLinesOnAfterSetFromFilters
- `OnCopyAttachmentsForPostedDocsLinesOnAfterSetToTableID(ToRecRef: RecordRef; var ToDocumentAttachmentLine: Record "Document Attachment")` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnCopyAttachmentsForPostedDocsLinesOnAfterSetToTableID
- `OnAfterTransformAttachmentDocumentTypeValue(TableNo: Integer; var AttachmentDocumentType: Enum "Attachment Document Type")` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnAfterTransformAttachmentDocumentTypeValue, [Codeunit 99000783 "Prod. Document Attachment Mgt."](../codeunit/99000783.md) OnAfterTransformAttachmentDocumentTypeValue
- `OnAfterIsServiceDocumentFlow(TableNo: Integer; var IsDocumentFlow: Boolean)` (integration)
  - subscribers: [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) OnAfterIsServiceDocumentFlow
- `OnAfterIsProductionDocumentFlow(TableNo: Integer; var IsDocumentFlow: Boolean)` (integration)
  - subscribers: [Codeunit 99000783 "Prod. Document Attachment Mgt."](../codeunit/99000783.md) OnAfterIsProductionDocumentFlow
- `OnMoveAttachmentsWithinSameRecordTypeOnBeforeInsert(var DocumentAttachmentToCreate: Record "Document Attachment"; MoveToRecRef: RecordRef; MoveToRecNo: Code[20])` (integration)

## Event subscriptions

- DeleteAttachedDocumentsOnAfterDeleteCustomer subscribes to Table "Customer" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteSalesHeader subscribes to Table "Sales Header" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteSalesLine subscribes to Table "Sales Line" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteSalesCreditMemoHeader subscribes to Table "Sales Cr.Memo Header" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteSalesCreditMemoLine subscribes to Table "Sales Cr.Memo Line" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteSalesInvoiceHeader subscribes to Table "Sales Invoice Header" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteSalesInvoiceLine subscribes to Table "Sales Invoice Line" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeletePurchInvHeader subscribes to Table "Purch. Inv. Header" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeletePurchInvLine subscribes to Table "Purch. Inv. Line" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeletePurchCreditMemoHeader subscribes to Table "Purch. Cr. Memo Hdr." OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeletePurchCreditMemoLine subscribes to Table "Purch. Cr. Memo Line" OnAfterDeleteEvent
- DocAttachFlowFromSalesQuoteToSalesOrder subscribes to Codeunit "Sales-Quote to Order" OnBeforeDeleteSalesQuote
- DocAttachFlowForSalesHeaderFromBlanketOrderToSalesOrder subscribes to Codeunit "Blanket Sales Order to Order" OnBeforeInsertSalesOrderHeader
- DocAttachFlowForSalesLinesFromBlanketOrderToSalesOrder subscribes to Codeunit "Blanket Sales Order to Order" OnAfterInsertSalesOrderLine
- DocAttachFlowForSalesHeaderFromSalesQuoteToSalesInvoice subscribes to Codeunit "Sales-Quote to Invoice" OnBeforeDeletionOfQuote
- DocAttachFlowForSalesLinesFromSalesQuoteToSalesInvoice subscribes to Codeunit "Sales-Quote to Invoice" OnBeforeInsertSalesInvoiceLine
- DocAttachFlowForSalesHeaderInsert subscribes to Table "Sales Header" OnAfterInsertEvent
- DocAttachFlowForSalesQuoteToSalesOrderSalesLines subscribes to Codeunit "Sales-Quote to Order" OnAfterInsertSalesOrderLine
- DocAttachFlowForSalesHeaderCustomerChg subscribes to Table "Sales Header" OnAfterValidateEvent (Sell-to Customer No.)
- DocAttachFlowForCopyDocumentSalesHeader subscribes to Codeunit "Copy Document Mgt." OnAfterCopySalesHeader
- DocAttachFlowForSalesLineInsert subscribes to Table "Sales Line" OnAfterInsertEvent
- DocAttachFlowForSalesLineItemChg subscribes to Table "Sales Line" OnAfterValidateEvent (No.)
- DocAttachForPostedSalesDocs subscribes to Codeunit "Sales-Post" OnBeforeDeleteAfterPosting
- DocAttachForPostedPurchaseDocs subscribes to Codeunit "Purch.-Post" OnBeforeDeleteAfterPosting
- DeleteAttachedDocumentsOnAfterDeleteVendor subscribes to Table "Vendor" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeletePurchaseHeader subscribes to Table "Purchase Header" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeletePurchaseLine subscribes to Table "Purchase Line" OnAfterDeleteEvent
- DocAttachFlowForPurchaseHeaderInsert subscribes to Table "Purchase Header" OnAfterInsertEvent
- DocAttachFlowForPurchaseHeaderVendorChange subscribes to Table "Purchase Header" OnAfterValidateEvent (Buy-from Vendor No.)
- DocAttachFlowForCopyDocumentPurchHeader subscribes to Codeunit "Copy Document Mgt." OnAfterCopyPurchaseHeader
- DocAttachFlowForPurchaseLineInsert subscribes to Table "Purchase Line" OnAfterInsertEvent
- DocAttachFlowForPurchaseLineItemChg subscribes to Table "Purchase Line" OnAfterValidateEvent (No.)
- DocAttachFlowForPurchQuoteToPurchOrder subscribes to Codeunit "Purch.-Quote to Order" OnBeforeDeletePurchQuote
- DocAttachFlowForPurchQuoteToPurchOrderLines subscribes to Codeunit "Purch.-Quote to Order" OnAfterInsertPurchOrderLine
- DocAttachFlowForBlanketPurchaseHeader subscribes to Codeunit "Blanket Purch. Order to Order" OnBeforePurchOrderHeaderModify
- DocAttachFlowForBlanketPurchaseLine subscribes to Codeunit "Blanket Purch. Order to Order" OnBeforeInsertPurchOrderLine
- DeleteAttachedDocumentsOnAfterDeleteItem subscribes to Table "Item" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteResource subscribes to Table "Resource" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteJob subscribes to Table "Job" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteEmployee subscribes to Table "Employee" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteFixedAsset subscribes to Table "Fixed Asset" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteOpportunity subscribes to Table "Opportunity" OnAfterDeleteEvent
- MoveAttachedDocumentsOnAfterRenameCustomer subscribes to Table "Customer" OnAfterRenameEvent
- MoveAttachedDocumentsOnAfterRenameVendor subscribes to Table "Vendor" OnAfterRenameEvent
- MoveAttachedDocumentsOnAfterRenameItem subscribes to Table "Item" OnAfterRenameEvent
- MoveAttachedDocumentsOnAfterRenameEmployee subscribes to Table "Employee" OnAfterRenameEvent
- MoveAttachedDocumentsOnAfterRenameFixedAsset subscribes to Table "Fixed Asset" OnAfterRenameEvent
- MoveAttachedDocumentsOnAfterRenameResource subscribes to Table "Resource" OnAfterRenameEvent
- MoveAttachedDocumentsOnAfterRenameJob subscribes to Table "Job" OnAfterRenameEvent
- MoveAttachedDocumentsOnAfterRenameOpportunity subscribes to Table "Opportunity" OnAfterRenameEvent

## Procedures

- `DeleteAttachedDocuments(RecRef: RecordRef)`
- `DeleteAttachedDocumentsWithConfirm(RecRef: RecordRef)`
- `AttachedDocumentsExist(RecRef: RecordRef): Boolean`
- `UpdateNumOfRecForFactbox(var Rec: Record "Document Attachment"; var NumberOfRecords: Integer)` (internal)
- `GetRefTable(var RecRef: RecordRef; DocumentAttachment: Record "Document Attachment"): Boolean`
- `SetDocumentAttachmentRelatedFiltersForRecRef(var DocumentAttachment: Record "Document Attachment"; RecRef: RecordRef)`
- `SetDocumentAttachmentFiltersForRecRef(var DocumentAttachment: Record "Document Attachment"; RecRef: RecordRef)`
- `SetDocumentAttachmentFiltersForRecRefInternal(var DocumentAttachment: Record "Document Attachment"; RecRef: RecordRef; GetRelatedAttachments: Boolean)` (internal)
- `IsSalesDocumentFlow(TableNo: Integer): Boolean` (internal)
- `IsPurchaseDocumentFlow(TableNo: Integer): Boolean` (internal)
- `IsServiceDocumentFlow(TableNo: Integer): Boolean` (internal)
- `IsProductionDocumentFlow(TableNo: Integer): Boolean` (internal)
- `IsFlowFieldsEditable(TableNo: Integer): Boolean` (internal)
- `TableHasNumberFieldPrimayKey(TableNo: Integer; var FieldNo: Integer): Boolean` (internal)
- `TableHasDocTypePrimaryKey(TableNo: Integer; var FieldNo: Integer): Boolean` (internal)
- `TableHasLineNumberPrimaryKey(TableNo: Integer; var FieldNo: Integer): Boolean` (internal)
- `TableHasVATReportConfigCodePrimaryKey(TableNo: Integer; var FieldNo: Integer): Boolean` (internal)
- `TransformAttachmentDocumentTypeValue(TableNo: Integer; var AttachmentDocumentType: Enum "Attachment Document Type")` (internal)
- `IsSupportedByFileViewerExtension(FileExtension: Text; IncludeImages: Boolean): Boolean` (internal)
- `IsSupportedByFileViewerFileName(FileName: Text; IncludeImages: Boolean): Boolean` (internal)
- `IsDuplicateFile(TableID: Integer; DocumentNo: Code[20]; AttachmentDocumentType: Enum "Attachment Document Type"; RecLineNo: Integer; FileName: Text; FileExtension: Text): Boolean`
- `CopyAttachments(FromRec: Variant; ToRec: Variant)`
- `CopyAttachments(var FromRecRef: RecordRef; var ToRecRef: RecordRef)`
- `CopyAttachmentsForPostedDocs(var FromRecRef: RecordRef; var ToRecRef: RecordRef)`
- `CopyAttachmentsForPostedDocsLines(var FromRecRef: RecordRef; var ToRecRef: RecordRef)`
- `MoveAttachmentsWithinSameRecordType(var MoveFromRecRef: RecordRef; var MoveToRecRef: RecordRef)`
- `ShowNotification(Variant: Variant; NumberOfReportsAttached: Integer; ShowAction: Boolean)`
- `ShowDocPrintedToAttachmentNotification(Variant: Variant; ShowAction: Boolean)`
- `ShowNotFoundPrintableReportsNotification(Variant: Variant)`
- `ShowDocumentAttachments(Notification: Notification)`
- `DeleteAttachedDocuments(ForVariantRec: Variant; WithConfirm: Boolean)`

Plus 9 local procedures.

## Triggers

OnRun

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 1511 "Notification Lifecycle Mgt."](../codeunit/1511.md) (2 calls: `ShowDocPrintedToAttachmentNotification → SendNotificationWithAdditionalContext`, `ShowNotFoundPrintableReportsNotification → SendNotification`)
- [Codeunit 27 "Confirm Management"](../codeunit/27.md) (1 call: `DeleteAttachedDocumentsWithConfirm → GetResponseOrDefault`)
- [Page 1173 "Document Attachment Details"](../page/1173.md) (1 call: `ShowDocumentAttachments → (object)`)

## Called by

- [Codeunit 6459 "Serv. Document Attachment Mgt."](../codeunit/6459.md) (34 calls: `CopyDocumentAttachmentsToPostedServiceDocument → CopyAttachmentsForPostedDocs`, `DeleteAttachedDocumentsOnAfterDeleteServiceContractHeader → DeleteAttachedDocuments`, `DeleteAttachedDocumentsOnAfterDeleteServiceContractLine → DeleteAttachedDocuments`, …)
- [Codeunit 99000783 "Prod. Document Attachment Mgt."](../codeunit/99000783.md) (13 calls: `DeleteAttachedDocumentsOnAfterDeleteProdOrderLine → DeleteAttachedDocuments`, `DeleteAttachedDocumentsOnAfterDeleteProductionBOM → DeleteAttachedDocuments`, `DeleteAttachedDocumentsOnAfterDeleteProductionOrder → DeleteAttachedDocuments`, …)
- [Table 1173 "Document Attachment"](../table/1173.md) (8 calls: `FindUniqueFileName → IsDuplicateFile`, `InitFieldsFromRecRef → TableHasDocTypePrimaryKey`, `InitFieldsFromRecRef → TableHasLineNumberPrimaryKey`, …)
- [Page 1173 "Document Attachment Details"](../page/1173.md) (6 calls: `OpenForRecRef → IsFlowFieldsEditable`, `OpenForRecRef → IsProductionDocumentFlow`, `OpenForRecRef → IsPurchaseDocumentFlow`, …)
- [Codeunit 6989 "Expense Attachment Mgt."](../codeunit/6989.md) (4 calls: `DeleteAttachedDocumentsOnAfterDeleteExpense → DeleteAttachedDocuments`, `DeleteAttachedDocumentsOnAfterDeleteExpenseReportLine → DeleteAttachedDocuments`, `UpdateReceiptAttachedOnExpense → AttachedDocumentsExist`, …)
- [Table 77 "Report Selections"](../table/77.md) (4 calls: `SaveAsDocumentAttachment → ShowNotification`, `SaveDocumentAttachmentFromRecRef → IsPurchaseDocumentFlow`, `SaveDocumentAttachmentFromRecRef → IsSalesDocumentFlow`, …)
- [Codeunit 6902 "Expense Rule Validation"](../codeunit/6902.md) (2 calls: `CheckForAttachmentsByRuleOnExpense → AttachedDocumentsExist`, `CheckForAttachmentsByRuleOnExpenseReportLine → AttachedDocumentsExist`)
- [Page 1178 "Doc. Attachment List Factbox"](../page/1178.md) (2 calls: `InitiateAttachFromEmail → GetRefTable`, `LoadAndRunDocumentAttachmentDetail → GetRefTable`)
- [Table 133 "Incoming Document Attachment"](../table/133.md) (2 calls: `SupportedByFileViewer → IsSupportedByFileViewerExtension`, `SupportedByFileViewer → IsSupportedByFileViewerFileName`)
- [Codeunit 5932 "Service-Get Shipment"](../codeunit/5932.md) (1 call: `CopyDocumentAttachments → CopyAttachments`)
- [Codeunit 64 "Sales-Get Shipment"](../codeunit/64.md) (1 call: `CopyDocumentAttachments → CopyAttachments`)
- [Codeunit 6638 "Sales-Get Return Receipts"](../codeunit/6638.md) (1 call: `CopyDocumentAttachments → CopyAttachments`)
- [Codeunit 6648 "Purch.-Get Return Shipments"](../codeunit/6648.md) (1 call: `CopyDocumentAttachments → CopyAttachments`)
- [Codeunit 6983 "Create Expense Report"](../codeunit/6983.md) (1 call: `CopyAttachments → CopyAttachments`)
- [Codeunit 6987 "Expense Report-Post"](../codeunit/6987.md) (1 call: `CopyDocumentAttachment → CopyAttachments`)
- [Codeunit 74 "Purch.-Get Receipt"](../codeunit/74.md) (1 call: `CopyDocumentAttachments → CopyAttachments`)
- [Codeunit 8898 "Map Email Source"](../codeunit/8898.md) (1 call: `FindRelatedAttachments → SetDocumentAttachmentRelatedFiltersForRecRef`)

## Recent changes

- 2026-09-29 [#11342 [29.x][ALL-E] Document Type is Quote in Document Attachment table (1173) after posting a Sales Invoice with attachmentsIntial Commit](../../changes/bcapps/11342.md) (releases/29.x, BC29, fix)
- 2026-09-16 [#11114 [Master][ALL-E] Document Type is Quote in Document Attachment table (1173) after posting a Sales Invoice with attachments.](../../changes/bcapps/11114.md) (main, BC30, fix)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-27, BC29

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Document Attachment Mgmt")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
