---
id: object/codeunit/9510
type: object
title: Codeunit 9510 "Document Service Management"
summary: Codeunit 9510 "Document Service Management" in Base Application (Microsoft.EServices.EDocument). 24 public procedures, 5 events, 6 event subscribers. Present since at least BC23, still in BC30, changed in BC25-26, BC28, BC30.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "30"
  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: ed29dd090d50e4f6368b5ae3cd2b29c5562d3e49a243d4e9d767c114871bef92
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/eServices/EDocument/DocumentServiceManagement.Codeunit.al
    title: src/Layers/W1/BaseApp/eServices/EDocument/DocumentServiceManagement.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 9510
name: Document Service Management
namespace: Microsoft.EServices.EDocument
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "25"
  - "26"
  - "28"
  - "30"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 78
  events: 5
  subscribers: 6
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 17
  called_by: 9
  implements: 0
---

# Codeunit 9510 "Document Service Management"

> Codeunit 9510 "Document Service Management" in Base Application (Microsoft.EServices.EDocument). 24 public procedures, 5 events, 6 event subscribers. Present since at least BC23, still in BC30, changed in BC25-26, BC28, BC30.

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

## Properties

| Property | Value |
|---|---|
| Permissions | tabledata "Tenant Media" = rimd |

## Events published

- `OnBeforeIsConfigured(var DocumentServiceRec: Record "Document Service")` (integration)
- `OnBeforeSetProperties(var DocumentServiceRec: Record "Document Service")` (integration)
- `OnGetSharePointClientId(var ClientId: Text)` (integration)
- `OnGetSharePointClientSecret(var ClientSecret: Text)` (integration)
- `OnGetSharePointRedirectURL(var RedirectURL: Text)` (integration)

## Event subscriptions

- OnTryAcquireAccessTokenOnOpenInExcel subscribes to Codeunit "System Action Triggers" OnOpenInExcel
- OnCanUploadDocument subscribes to Codeunit "Document Sharing" OnCanUploadDocument
- OnCanUploadSystemDocument subscribes to Codeunit "Document Sharing" OnCanUploadSystemDocument
- OnUploadDocument subscribes to Codeunit "Document Sharing" OnUploadDocument
- OnGetFileContents subscribes to Codeunit "Document Sharing" OnGetFileContents
- OnDeleteDocument subscribes to Codeunit "Document Sharing" OnDeleteDocument

## Procedures

- `TestConnection()`
- `SaveFile(SourcePath: Text; TargetName: Text; ConflictBehavior: Enum "Doc. Sharing Conflict Behavior"): Text`
- `RunDocumentServiceSetup(Notification: Notification)`
- `GetOneDriveScenario(var DocumentServiceScenario: Record "Document Service Scenario"): Boolean`
- `IsConfiguredLegacy(): Boolean`
- `IsConfigured(): Boolean`
- `IsServiceUri(TargetURI: Text): Boolean`
- `SetServiceType(RequestedServiceType: Text)`
- `GetServiceType(): Text`
- `OpenDocument(TargetURI: Text)`
- `GetDefaultFolderName(): Text[250]`
- `TryGetDefaultLocation(var Location: Text[250])`
- `GetMyBusinessCentralFilesLink(): Text`
- `SetClientSecret(ClientSecret: SecretText)` (internal)
- `TryGetClientSecretFromIsolatedStorage(var ClientSecret: SecretText)` (internal)
- `OpenInOneDrive(FileName: Text; FileExtension: Text; InStream: InStream)`
- `EditInOneDrive(FileName: Text; FileExtension: Text; var TempBlob: Codeunit "Temp Blob"): Boolean`
- `EditInOneDrive(FileName: Text; FileExtension: Text; DocSharingConflictBehavior: Enum "Doc. Sharing Conflict Behavior"; var TempBlob: Codeunit "Temp Blob"): Boolean`
- `OpenInOneDriveFromMedia(FileName: Text; FileExtension: Text; MediaId: Guid)`
- `EditInOneDriveFromMedia(FileName: Text; FileExtension: Text; MediaId: Guid): Boolean`
- `ShareWithOneDrive(FileName: Text; FileExtension: Text; InStream: InStream)`
- `ShareWithOneDriveFromMedia(FileName: Text; FileExtension: Text; MediaId: Guid)`
- `TestLocationResolves(Location: Text[250]; AccessToken: SecretText): Boolean`
- `GetTelemetryCategory(): Text` (internal)

Plus 43 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 1297 "Http Web Request Mgt."](../codeunit/1297.md) (16 calls: `DeleteDriveItem → SendRequestAndReadTextResponse`, `GetDefaultLocation → AddHeader`, `GetDefaultLocation → DisableUI`, …)
- [Codeunit 457 "Environment Information"](../codeunit/457.md) (8 calls: `GetAccessToken → IsSaaSInfrastructure`, `GetClientId → IsSaaSInfrastructure`, `GetClientSecret → IsSaaSInfrastructure`, …)
- [Codeunit 6300 "Azure AD Mgt."](../codeunit/6300.md) (6 calls: `GetAccessToken → GetAccessTokenAsSecretText`, `GetAccessToken → GetOnBehalfAccessTokenAsSecretText`, `GetDefaultLocation → GetOnBehalfAccessTokenAsSecretText`, …)
- [Codeunit 1357 "Privacy Notice Registrations"](../codeunit/1357.md) (4 calls: `GetMyBusinessCentralFilesLink → GetOneDrivePrivacyNoticeId`, `OnCanUploadDocument → GetOneDrivePrivacyNoticeId`, `OnCanUploadSystemDocument → GetOneDrivePrivacyNoticeId`, …)
- [Codeunit 1563 "Privacy Notice"](../codeunit/1563.md) (4 calls: `GetMyBusinessCentralFilesLink → ConfirmPrivacyNoticeApproval`, `OnCanUploadDocument → IsApprovalStateDisagreed`, `OnCanUploadSystemDocument → IsApprovalStateDisagreed`, …)
- [Codeunit 1293 "Isolated Storage Management"](../codeunit/1293.md) (3 calls: `GetClientSecretFromIsolatedStorage → Get`, `SetClientSecret → Delete`, `SetClientSecret → Set`)
- [Codeunit 3060 "Uri"](../codeunit/3060.md) (3 calls: `GetResourceUrl → GetHost`, `GetResourceUrl → Init`, `MakeChildrenPathUrl → EscapeDataString`)
- [Codeunit 501 "OAuth2"](../codeunit/501.md) (3 calls: `GetAccessToken → AcquireAuthorizationCodeTokenFromCache`, `GetAccessToken → AcquireTokenByAuthorizationCode`, `InitializeDefaultService → GetDefaultRedirectURL`)
- [Codeunit 9560 "Document Sharing"](../codeunit/9560.md) (3 calls: `InvokeDocumentSharingFlowFromMedia → (object)`, `OpenInOneDrive → Share`, `ShareWithOneDrive → Share`)
- [Codeunit 2200 "Azure Key Vault"](../codeunit/2200.md) (2 calls: `GetClientId → GetAzureKeyVaultSecret`, `GetClientSecret → GetAzureKeyVaultSecret`)
- [Codeunit 3061 "Uri Builder"](../codeunit/3061.md) (2 calls: `GetDefaultLocation → GetHost`, `GetDefaultLocation → Init`)
- [Codeunit 4100 "Temp Blob"](../codeunit/4100.md) (2 calls: `GetFileContent → CreateInStream`, `GetFileContent → Length`)
- [Codeunit 419 "File Management"](../codeunit/419.md) (2 calls: `GetSafeDocumentServiceFolderName → GetSafeFileName`, `OnUploadDocument → GetSafeFileName`)
- [Codeunit 9005 "Url Helper"](../codeunit/9005.md) (2 calls: `GetDefaultLocation → GetGraphUrl`, `GetGraphDomain → GetGraphUrl`)
- [Codeunit 1266 "Cryptography Management"](../codeunit/1266.md) (1 call: `InvokeDocumentSharingFlowFromMedia → GenerateHash`)
- [Codeunit 8703 "Feature Telemetry"](../codeunit/8703.md) (1 call: `GetAccessToken → LogUsage`)
- [Page 9553 "Document Service Setup"](../page/9553.md) (1 call: `RunDocumentServiceSetup → (object)`)

## Called by

- [Page 9553 "Document Service Setup"](../page/9553.md) (5 calls: `AppendSaasChangesToSummaryList → TryGetDefaultLocation`, `LoadSettings → GetOneDriveScenario`, `ShowMigrationStep → GetDefaultFolderName`, …)
- [Table 370 "Excel Buffer"](../table/370.md) (4 calls: `OpenUsingDocumentService → IsConfigured`, `OpenUsingDocumentService → IsServiceUri`, `OpenUsingDocumentService → OpenDocument`, …)
- [Codeunit 9660 "Report Layouts Impl."](../codeunit/9660.md) (3 calls: `EditInOneDrive → EditInOneDrive`, `OpenInOneDrive → OpenInOneDrive`, `ShareWithOneDrive → ShareWithOneDrive`)
- [Table 1173 "Document Attachment"](../table/1173.md) (3 calls: `OpenInOneDrive → EditInOneDriveFromMedia`, `OpenInOneDrive → OpenInOneDriveFromMedia`, `OpenInOneDrive → ShareWithOneDriveFromMedia`)
- [Table 20405 "Qlty. Inspection Header"](../table/20405.md) (2 calls: `ProcessAdditionalPictureHandling → IsConfigured`, `ProcessAdditionalPictureHandling → ShareWithOneDrive`)
- [Table 477 "Report Inbox"](../table/477.md) (2 calls: `OpenInOneDrive → OpenInOneDrive`, `ShareWithOneDrive → ShareWithOneDrive`)
- [Page extension 9204 "User Settings"](../pageextension/9204.md) (1 call: `SetOneDriveLinkVisibilityAndText → GetTelemetryCategory`)
- [Table 20400 "Qlty. Management Setup"](../table/20400.md) (1 call: `SanityCheckPictureAndCameraSettings → IsConfigured`)
- [Table 5076 "Segment Header"](../table/5076.md) (1 call: `ModifyWordTemplateAttachment → EditInOneDrive`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC25-26, BC28, BC30

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 Service Management")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
