Codeunit 8751 "DA External Storage Impl."
External Storage - Document Attachments · Microsoft.ExternalStorage.DocumentAttachments
Across versions
- BC23-28not present
- BC29-30present
Neighbourhood 10 connected objects and pages
External Storage - Document Attachments · Microsoft.ExternalStorage.DocumentAttachments · BC29-30 · source at 4e6a307c · facts from BC29
Properties
| Property | Value |
|---|---|
| Access | Internal |
| Permissions | tabledata “Tenant Media” = rimd, tabledata “Document Attachment” = rimd, tabledata “File Account” = r, tabledata “DA External Storage Setup” = r |
Event subscriptions
- OnAfterInsertDocumentAttachment subscribes to Table “Document Attachment” OnAfterInsertEvent
- OnAfterDeleteDocumentAttachment subscribes to Table “Document Attachment” OnAfterDeleteEvent
- DocumentAttachment_OnBeforeExportToStream subscribes to Table “Document Attachment” OnBeforeExportToStream
- DocumentAttachment_OnBeforeGetAsTempBlob subscribes to Table “Document Attachment” OnBeforeGetAsTempBlob
- DocumentAttachment_OnBeforeGetContentType subscribes to Table “Document Attachment” OnBeforeGetContentType
- DocumentAttachment_OnBeforeHasContent subscribes to Table “Document Attachment” OnBeforeHasContent
- Document Attachment_OnInsertOnBeforeCheckDocRefID subscribes to Table “Document Attachment” OnInsertOnBeforeCheckDocRefID
- Document Attachment Mgmt_OnCopyAttachmentsOnAfterSetToDocumentFilters subscribes to Codeunit “Document Attachment Mgmt” OnCopyAttachmentsOnAfterSetToDocumentFilters
- Document Attachment_OnBeforeOpenInOneDrive subscribes to Table “Document Attachment” OnBeforeOpenInOneDrive
Procedures
BeforeAddOrModifyFileScenarioCheck(Scenario: Enum "File Scenario"; Connector: Enum "Ext. File Storage Connector"): Boolean: Called before adding or modifying a file scenario.GetAdditionalScenarioSetup(Scenario: Enum "File Scenario"; Connector: Enum "Ext. File Storage Connector"): Boolean: Called to get additional setup for a file scenario.BeforeDeleteFileScenarioCheck(Scenario: Enum "File Scenario"; Connector: Enum "Ext. File Storage Connector"): Boolean: Called before deleting a file scenario.BeforeReassignFileScenarioCheck(Scenario: Enum "File Scenario"): BooleanUploadToExternalStorage(var DocumentAttachment: Record "Document Attachment"): Boolean: Provides functionality to manage document attachments in external storage systems. Handles upload, download, and deletion operations for Business Central attachments.UploadToExternalStorage(var DocumentAttachment: Record "Document Attachment"; var FailureReason: Text): Boolean: Uploads a document attachment to external storage and explains why an upload was not performed.GetLastCreatedExternalFilePath(): Text[2048](internal): Gets the path created by the last upload attempt.DownloadFromExternalStorage(var DocumentAttachment: Record "Document Attachment"): Boolean: Downloads a document attachment from external storage and prompts user to save it locally.DownloadFromExternalStorageToInternal(var DocumentAttachment: Record "Document Attachment"): Boolean: Downloads a document attachment from external storage and saves it to internal storage.DownloadFromExternalStorageToInternal(var DocumentAttachment: Record "Document Attachment"; var FailureReason: Text): Boolean: Downloads a document attachment from external storage, saves it to internal storage, and explains why a download was not performed.DownloadFromExternalStorageToStream(ExternalFilePath: Text; var AttachmentOutStream: OutStream): Boolean: Downloads a document attachment from external storage to a stream.DownloadFromExternalStorageToTempBlob(ExternalFilePath: Text; var TempBlob: Codeunit "Temp Blob"): Boolean: Downloads a document attachment from external storage to a Temp Blob.DeleteFromExternalStorage(var DocumentAttachment: Record "Document Attachment"): Boolean: Retires a document attachment’s local external reference without deleting remote content.DeleteFromExternalStorage(var DocumentAttachment: Record "Document Attachment"; var FailureReason: Text): Boolean: Retires a local external reference through the canonical internal-content guard.RetireExternalReference(var DocumentAttachment: Record "Document Attachment"; var FailureReason: Text): Boolean(internal)GetExternalDeletionBlockedMessage(): Text(internal)DeleteFromInternalStorage(var DocumentAttachment: Record "Document Attachment"): Boolean: Deletes a document attachment from internal storage.DeleteFromInternalStorage(var DocumentAttachment: Record "Document Attachment"; var FailureReason: Text): Boolean: Deletes a document attachment from internal storage and explains why a deletion was not performed.FileExtensionToContentMimeType(var Rec: Record "Document Attachment"; var ContentType: Text[100]): Maps file extensions to their corresponding MIME types.IsFileUploadedToExternalStorageAndDeletedInternally(var DocumentAttachment: Record "Document Attachment"): Boolean: Checks if a Document Attachment file is uploaded to external storage and not stored internally.SelectRootFolder(): Text: Opens a folder selection dialog for choosing the root folder.SanitizeTableNameFolder(TableName: Text; TableID: Integer): Text[100](internal)GetCurrentEnvironmentHash(): Text[32]: Gets the current environment hash for use in folder structure.IsFileFromAnotherEnvironmentOrCompany(DocumentAttachment: Record "Document Attachment"): Boolean: Checks if a file belongs to another environment or company.MigrateFileToCurrentEnvironment(var DocumentAttachment: Record "Document Attachment"): Boolean: Migrates a file from a previous environment or company folder to the current one.RunCompanyMigration(): Integer: Runs migration for all document attachments from a previous company.CanLogLastFailureReasonToTelemetry(): Boolean(internal)
Plus 12 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 9454 “External File Storage” (14 calls:
DownloadFromExternalStorage → GetFile,DownloadFromExternalStorage → Initialize,DownloadFromExternalStorageToStream → GetFile, …) - Codeunit 9452 “File Scenario” (7 calls:
BeforeAddOrModifyFileScenarioCheck → GetSpecificFileAccount,DownloadFromExternalStorage → GetSpecificFileAccount,DownloadFromExternalStorageToStream → GetSpecificFileAccount, …) - Codeunit 8754 “DA Feature Telemetry” (6 calls:
DocumentAttachment_OnBeforeExportToStream → LogFileDownloadFailed,DocumentAttachment_OnBeforeGetAsTempBlob → LogFileDownloadFailed,DownloadFromExternalStorage → LogFileDownloaded, …) - Codeunit 4100 “Temp Blob” (3 calls:
DownloadFromExternalStorageToTempBlob → CreateOutStream,MigrateFileToCurrentEnvironment → CreateInStream,MigrateFileToCurrentEnvironment → CreateOutStream) - Codeunit 1266 “Cryptography Management” (1 call:
GetCurrentEnvironmentHash → GenerateHash) - Codeunit 27 “Confirm Management” (1 call:
BeforeAddOrModifyFileScenarioCheck → GetResponseOrDefault) - Codeunit 457 “Environment Information” (1 call:
GetCurrentEnvironmentHash → GetEnvironmentName)
Called by
- Codeunit 8755 “DA Ext. Storage Sync Worker” (6 calls:
GetLastCreatedExternalFilePath → GetLastCreatedExternalFilePath,OnRun → CanLogLastFailureReasonToTelemetry,OnRun → DeleteFromInternalStorage, …) - Page 8750 “DA External Storage Setup” (3 calls:
OnOpenPage → GetCurrentEnvironmentHash,OnOpenPage → GetExternalDeletionBlockedMessage,SelectRootFolder → SelectRootFolder) - Page 8751 “Document Attachment - External” (1 call:
OnOpenPage → GetExternalDeletionBlockedMessage)
Implements
Recent changes
- 2026-11-20 #14331 Fix trailing periods in generated document attachment folders (main, BC30, fix)
- 2026-10-14 #12432 [AB#647643] Retain remote files and safely retire verified local references (main, BC30, fix)
- 2026-10-09 #11733 Fix external storage migration for unsafe attachment filenames (main, BC30, fix)
- 2026-09-15 #10828 Avoid remote attachment checks during FactBox refresh (main, BC30, performance)
- 2026-08-17 #10055 Fix: migrating a document attachment deletes shared Tenant Media (main, BC30, fix)
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Manage Attachments, Links, and Notes on Cards and Documents — possibly related: Manages document attachments storage and functionality as page describes. (model-linked)
- Store Document Attachments in External File Storage — possibly related: Codeunit implements external storage for document attachments as page documents. (model-linked)
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: "DA External Storage Impl."), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.