---
id: object/codeunit/6459
type: object
title: Codeunit 6459 "Serv. Document Attachment Mgt."
summary: Codeunit 6459 "Serv. Document Attachment Mgt." in Base Application (Microsoft.Service.Document). 1 public procedures, 51 event subscribers. Introduced in BC25, still in BC30, changed in BC28-29.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: "25"
  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: 1e32038a461f948e97bf40e313df6cc49a0d6c79d0dfa01b1fb46a4c79820f27
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Service/Document/ServDocumentAttachmentMgt.Codeunit.al
    title: src/Layers/W1/BaseApp/Service/Document/ServDocumentAttachmentMgt.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: 6459
name: Serv. Document Attachment Mgt.
namespace: Microsoft.Service.Document
app: Base Application
extends: null
first_version: "25"
last_version: "30"
present_in:
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "28"
  - "29"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 53
  events: 0
  subscribers: 51
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 1
  called_by: 0
  implements: 0
---

# Codeunit 6459 "Serv. Document Attachment Mgt."

> Codeunit 6459 "Serv. Document Attachment Mgt." in Base Application (Microsoft.Service.Document). 1 public procedures, 51 event subscribers. Introduced in BC25, still in BC30, changed in BC28-29.

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

## Event subscriptions

- OnInsertOrderTrackingEntry subscribes to Table "Document Attachment" OnAfterIsPostedDocument
- OnAfterIsServiceDocumentFlow subscribes to Codeunit "Document Attachment Mgmt" OnAfterIsServiceDocumentFlow
- OnAfterGetRefTable subscribes to Codeunit "Document Attachment Mgmt" OnAfterGetRefTable
- OnSetRelatedAttachmentsFilterOnBeforeSetTableIdFilter subscribes to Codeunit "Document Attachment Mgmt" OnSetRelatedAttachmentsFilterOnBeforeSetTableIdFilter
- OnAfterIsTableDocument subscribes to Codeunit "Document Attachment Mgmt" OnAfterTableIsDocument
- OnAfterTableHasNumberFieldPrimaryKey subscribes to Codeunit "Document Attachment Mgmt" OnAfterTableHasNumberFieldPrimaryKey
- OnAfterTableHasDocTypePrimaryKey subscribes to Codeunit "Document Attachment Mgmt" OnAfterTableHasDocTypePrimaryKey
- OnAfterTableHasLineNumberPrimaryKey subscribes to Codeunit "Document Attachment Mgmt" OnAfterTableHasLineNumberPrimaryKey
- OnCopyAttachmentsOnAfterSetFromParameters subscribes to Codeunit "Document Attachment Mgmt" OnCopyAttachmentsOnAfterSetFromParameters
- OnAfterTransformAttachmentDocumentTypeValue subscribes to Codeunit "Document Attachment Mgmt" OnAfterTransformAttachmentDocumentTypeValue
- OnCopyAttachmentsOnAfterSetDocumentFlowFilter subscribes to Codeunit "Document Attachment Mgmt" OnCopyAttachmentsOnAfterSetDocumentFlowFilter
- OnCopyAttachmentsOnAfterSetToParameters subscribes to Codeunit "Document Attachment Mgmt" OnCopyAttachmentsOnAfterSetToParameters
- OnCopyAttachmentsOnAfterSetToDocumentFilters subscribes to Codeunit "Document Attachment Mgmt" OnCopyAttachmentsOnAfterSetToDocumentFilters
- OnAfterTableIsDocumentHeader subscribes to Codeunit "Document Attachment Mgmt" OnAfterTableIsDocumentHeader
- OnAfterTableIsDocumentLine subscribes to Codeunit "Document Attachment Mgmt" OnAfterTableIsDocumentLine
- OnAfterTableIsEntity subscribes to Codeunit "Document Attachment Mgmt" OnAfterTableIsEntity
- OnCopyAttachmentsForPostedDocsLinesOnAfterSetFromFilters subscribes to Codeunit "Document Attachment Mgmt" OnCopyAttachmentsForPostedDocsLinesOnAfterSetFromFilters
- OnCopyAttachmentsForPostedDocsLinesOnAfterSetToTableID subscribes to Codeunit "Document Attachment Mgmt" OnCopyAttachmentsForPostedDocsLinesOnAfterSetToTableID
- OnBeforeSetDocumentTypeForPostedDocument subscribes to Codeunit "Document Attachment Mgmt" OnBeforeSetDocumentTypeForPostedDocument
- DeleteAttachedDocumentsOnAfterDeleteServiceItem subscribes to Table "Service Item" OnAfterDeleteEvent
- MoveAttachedDocumentsOnAfterRenameServiceItem subscribes to Table "Service Item" OnAfterRenameEvent
- DeleteAttachedDocumentsOnAfterDeleteServiceHeader subscribes to Table "Service Header" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteServiceLine subscribes to Table "Service Line" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteServiceInvoiceHeader subscribes to Table "Service Invoice Header" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteServiceInvoiceLine subscribes to Table "Service Invoice Line" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteServiceCreditMemoHeader subscribes to Table "Service Cr.Memo Header" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteServiceCreditMemoLine subscribes to Table "Service Cr.Memo Line" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteServiceContractHeader subscribes to Table "Service Contract Header" OnAfterDeleteEvent
- DeleteAttachedDocumentsOnAfterDeleteServiceContractLine subscribes to Table "Service Contract Line" OnAfterDeleteEvent
- DocumentAttachmentFlow_ForServiceItemInsert subscribes to Table "Service Item" OnAfterInsertEvent
- DocumentAttachmentFlow_ForServiceItemItemNoChange subscribes to Table "Service Item" OnAfterValidateEvent (Item No.)
- DocumentAttachmentFlow_ForServiceHeaderInsert subscribes to Table "Service Header" OnAfterInsertEvent
- DocumentAttachmentFlow_ForServiceHeaderCustomerNoChange subscribes to Table "Service Header" OnAfterValidateEvent (Customer No.)
- DocumentAttachmentFlow_ForServiceHeaderCustomerChange_OnCreateServHeaderOnAfterCopyFromCustomer subscribes to Codeunit "ServContractManagement" OnCreateServHeaderOnAfterCopyFromCustomer
- DocumentAttachmentFlow_ForServiceHeaderCustomerChange_OnCreateOrGetCreditHeaderOnAfterCopyFromCustomer subscribes to Codeunit "ServContractManagement" OnCreateOrGetCreditHeaderOnAfterCopyFromCustomer
- DocumentAttachmentFlow_ForServiceLineInsert subscribes to Table "Service Line" OnAfterInsertEvent
- DocumentAttachmentFlow_ForServiceLineServiceItemNoChange subscribes to Table "Service Line" OnAfterValidateEvent (Service Item No.)
- DocumentAttachmentFlow_ForServiceLineServiceItemLineNoChange subscribes to Table "Service Line" OnAfterValidateEvent (Service Item Line No.)
- DocumentAttachmentFlow_ForServiceLineNoChange subscribes to Table "Service Line" OnAfterValidateEvent (No.)
- DocumentAttachmentFlow_FromServiceQuoteHeaderToServiceOrderHeader subscribes to Codeunit "Service-Quote to Order" OnBeforeServiceHeaderOrderModify
- DocumentAttachmentFlow_FromServiceQuoteLineToServiceOrderLine subscribes to Codeunit "Service-Quote to Order" OnAfterServOrderLineInsert
- CopyDocumentAttachmentsToPostedServiceDocument subscribes to Codeunit "Serv-Documents Mgt." OnFinalizeOnBeforeDeleteHeaderAndLines
- DocumentAttachmentFlow_ForServiceContractHeaderInsert subscribes to Table "Service Contract Header" OnAfterInsertEvent
- DocumentAttachmentFlow_ForServiceContractHeaderCustomerNoChange subscribes to Table "Service Contract Header" OnAfterValidateEvent (Customer No.)
- DocumentAttachmentFlow_ForServiceContractHeaderCustomerChange_OnChangeCustNoOnServContractOnAfterGetCustomer subscribes to Codeunit "ServContractManagement" OnChangeCustNoOnServContractOnAfterGetCustomer
- DocumentAttachmentFlow_ForServiceContractLineInsert subscribes to Table "Service Contract Line" OnAfterInsertEvent
- DocumentAttachmentFlow_ForServiceContractLineServiceItemNoChange subscribes to Table "Service Contract Line" OnAfterValidateEvent (Service Item No.)
- DocumentAttachmentFlow_ForServiceContractLineItemNoChange subscribes to Table "Service Contract Line" OnAfterValidateEvent (Item No.)
- DocumentAttachmentFlow_FromServiceContractQuoteHeaderToServiceContractHeader subscribes to Codeunit "SignServContractDoc" OnAfterToServContractHeaderInsert
- DocumentAttachmentFlow_FromServiceContractQuoteLineToServiceContractLine subscribes to Codeunit "SignServContractDoc" OnAfterToServContractLineInsert
- DocumentAttachmentFlow_OnServiceContractLineCopy subscribes to Codeunit "Copy Service Contract Mgt." OnAfterProcessServiceContractLine

## Procedures

- `IsServiceDocumentFlow(TableNo: Integer): Boolean` (internal)

Plus 1 local procedures.

## 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 1173 "Document Attachment Mgmt"](../codeunit/1173.md) (34 calls: `CopyDocumentAttachmentsToPostedServiceDocument → CopyAttachmentsForPostedDocs`, `DeleteAttachedDocumentsOnAfterDeleteServiceContractHeader → DeleteAttachedDocuments`, `DeleteAttachedDocumentsOnAfterDeleteServiceContractLine → DeleteAttachedDocuments`, …)

## 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: BC25-30
- Changed (declaration) in: BC28-29

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: "Serv. Document Attachment Mgt.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
