---
id: object/codeunit/1410
type: object
title: Codeunit 1410 "Doc. Exch. Service Mgt."
summary: Codeunit 1410 "Doc. Exch. Service Mgt." in Base Application (Microsoft.EServices.EDocument). 35 public procedures, 8 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in BC24-25, 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: ebdd9b6bc68bfbc99503b3fc975b98d78cb070102604e74a233eac25be844e37
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/eServices/EDocument/DocExchServiceMgt.Codeunit.al
    title: src/Layers/W1/BaseApp/eServices/EDocument/DocExchServiceMgt.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/11171
object_type: codeunit
object_id: 1410
name: Doc. Exch. Service Mgt.
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:
  - "24"
  - "25"
  - "28"
  - "30"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 120
  events: 8
  subscribers: 1
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 3
  calls: 10
  called_by: 8
  implements: 0
---

# Codeunit 1410 "Doc. Exch. Service Mgt."

> Codeunit 1410 "Doc. Exch. Service Mgt." in Base Application (Microsoft.EServices.EDocument). 35 public procedures, 8 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in BC24-25, 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/DocExchServiceMgt.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Permissions | TableData "Sales Invoice Header" = rm, TableData "Sales Cr.Memo Header" = rm |

## Events published

- `OnAfterIncomingDocReceivedFromDocExch(var IncomingDocument: Record "Incoming Document")` (integration)
  - subscribers: [Codeunit 1520 "Workflow Event Handling"](../codeunit/1520.md) RunWorkflowOnAfterIncomingDocReceivedFromDocExch
- `OnGetClientId(var ClientId: Text)` (integration)
- `OnGetClientSecret(var ClientSecret: Text)` (integration)
- `OnBeforeSendActivateAppNotification(var IsHandled: Boolean)` (integration)
- `OnBeforeSetURLsToDefault(var DocExchServiceSetup: Record "Doc. Exch. Service Setup"; Sandbox: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeVerifyPrerequisites(ShowFailure: Boolean; var Success: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeCheckDocumentStatus(DocRecRef: RecordRef; var IsHandled: Boolean)` (integration)
  - subscribers: [Codeunit 6468 "Serv. Doc. Exchange Mgt."](../codeunit/6468.md) OnBeforeCheckDocumentStatus
- `OnBeforeGetPostSalesURL(DocRecRef: RecordRef; var URL: Text)` (integration)
  - subscribers: [Codeunit 6468 "Serv. Doc. Exchange Mgt."](../codeunit/6468.md) OnBeforeGetPostSalesURL

## Event subscriptions

- HandleVANRegisterServiceConnection subscribes to Table "Service Connection" OnRegisterServiceConnection

## Procedures

- `IsSandbox(var DocExchServiceSetup: Record "Doc. Exch. Service Setup"): Boolean`
- `SetURLsToDefault(var DocExchServiceSetup: Record "Doc. Exch. Service Setup")`
- `SetURLsToDefault(var DocExchServiceSetup: Record "Doc. Exch. Service Setup"; Sandbox: Boolean)`
- `GetAppUrl(var DocExchServiceSetup: Record "Doc. Exch. Service Setup"): Text`
- `GetDefaultRedirectUrl(): Text`
- `SetDefaultRedirectUrl(var DocExchServiceSetup: Record "Doc. Exch. Service Setup")`
- `SendRenewTokenNotification()`
- `RecallActivateAppNotification()`
- `SendActivateAppNotification()`
- `ActivateApp(var ActivateAppNotification: Notification)`
- `RenewToken(var RenewTokenNotification: Notification)`
- `RenewToken(TryRefreshToken: Boolean)`
- `GetFeatureTelemetryName(): Text` (internal)
- `CheckConnection()`
- `SendUBLDocument(DocVariant: Variant; var TempBlob: Codeunit "Temp Blob"): Text`
- `SendDocument(DocVariant: Variant; var TempBlob: Codeunit "Temp Blob"): Text`
- `HasPredefinedOAuth2Params(): Boolean`
- `GetClientId(Sandbox: Boolean): Text`
- `GetClientSecretAsSecretText(Sandbox: Boolean): SecretText`
- `AcquireAccessTokenByAuthorizationCode(EnabledOnly: Boolean)`
- `AcquireAccessTokenByRefreshToken()`
- `GetDocumentStatus(DocRecordID: RecordID; DocIdentifier: Text[50]; DocOrigIdentifier: Text[50]): Text`
- `GetDocumentMetadata(DocRecordID: RecordID; DocIdentifier: Text[50]; var NewStatus: Text): Boolean`
- `ReceiveDocuments(ContextRecordID: RecordID)`
- `CheckCredentials()`
- `CheckServiceEnabled()`
- `GetServiceSetUp(var DocExchServiceSetup: Record "Doc. Exch. Service Setup")`
- `GetPostSalesInvURL(): Text`
- `GetPostSalesCrMemoURL(): Text`
- `LogActivitySucceeded(RelatedRecordID: RecordID; ActivityDescription: Text; ActivityMessage: Text)`
- `LogActivityFailed(RelatedRecordID: RecordID; ActivityDescription: Text; ActivityMessage: Text)`
- `LogActivityFailedAndError(RelatedRecordID: RecordID; ActivityDescription: Text; ActivityMessage: Text)`
- `EnableTraceLog(NewTraceLogEnabled: Boolean)`
- `GetExternalDocURL(DocID: Text): Text`
- `VerifyPrerequisites(ShowFailure: Boolean): Boolean`

Plus 76 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) (24 calls: `CreateIncomingDocEntry → TryLoadXMLResponse`, `GetDocDispatchErrors → TryLoadXMLResponse`, `GetDocumentMetadata → TryLoadXMLResponse`, …)
- [Codeunit 6224 "XML DOM Management"](../codeunit/6224.md) (8 calls: `ExtractAdditionalAttachment → GetAttributeValue`, `GetDocDispatchErrors → FindNodeTextWithNamespace`, `GetDocumentMetadata → FindNodeTextWithNamespace`, …)
- [Codeunit 1292 "Trace"](../codeunit/1292.md) (5 calls: `CheckConnection → LogStreamToTempFile`, `DispatchDocument → LogStreamToTempFile`, `GetDocDispatchErrors → LogStreamToTempFile`, …)
- [Codeunit 419 "File Management"](../codeunit/419.md) (3 calls: `ExtractAdditionalAttachment → GetExtension`, `ExtractAdditionalAttachment → IsAllowedPath`, `ExtractAdditionalAttachment → ServerTempFileName`)
- [Codeunit 457 "Environment Information"](../codeunit/457.md) (3 calls: `GetMissingClientIdOrSecretErr → IsSaaSInfrastructure`, `GetPredefinedClientId → IsSaaSInfrastructure`, `GetPredefinedClientSecret → IsSaaSInfrastructure`)
- [Codeunit 1411 "Doc. Exch. Links"](../codeunit/1411.md) (2 calls: `DispatchDocument → UpdateDocumentRecord`, `SendUBLDocument → UpdateDocumentRecord`)
- [Codeunit 2200 "Azure Key Vault"](../codeunit/2200.md) (2 calls: `GetPredefinedClientId → GetAzureKeyVaultSecret`, `GetPredefinedClientSecret → GetAzureKeyVaultSecret`)
- [Codeunit 4100 "Temp Blob"](../codeunit/4100.md) (2 calls: `TryAcquireAccessToken → CreateOutStream`, `TryAcquireAccessToken → Length`)
- [Codeunit 8703 "Feature Telemetry"](../codeunit/8703.md) (2 calls: `SendUBLDocument → LogUptake`, `SendUBLDocument → LogUsage`)
- [Codeunit 501 "OAuth2"](../codeunit/501.md) (1 call: `GetDefaultRedirectUrl → GetDefaultRedirectURL`)

## Called by

- [Page 1275 "Doc. Exch. Service Setup"](../page/1275.md) (8 calls: `OnInit → HasPredefinedOAuth2Params`, `OnOpenPage → GetAppUrl`, `OnOpenPage → GetClientId`, …)
- [Table 1275 "Doc. Exch. Service Setup"](../table/1275.md) (7 calls: `CheckConnection → CheckConnection`, `EnableConnection → AcquireAccessTokenByAuthorizationCode`, `EnableConnection → CheckConnection`, …)
- [Codeunit 6468 "Serv. Doc. Exchange Mgt."](../codeunit/6468.md) (4 calls: `CheckAndUpdateDocExchServiceCrMemoStatus → GetDocumentStatus`, `CheckAndUpdateDocExchServiceInvoiceStatus → GetDocumentStatus`, `OnBeforeGetPostSalesURL → GetPostSalesCrMemoURL`, …)
- [Codeunit 1411 "Doc. Exch. Links"](../codeunit/1411.md) (2 calls: `CheckAndUpdateDocExchCrMemoStatus → GetDocumentStatus`, `CheckAndUpdateDocExchInvoiceStatus → GetDocumentStatus`)
- [Codeunit 1420 "Doc. Exch. Serv.- Doc. Status"](../codeunit/1420.md) (1 call: `DefaultDocExchStatusDrillDown → GetExternalDocURL`)
- [Codeunit 1421 "Doc. Exch. Serv. - Recv. Docs."](../codeunit/1421.md) (1 call: `OnRun → ReceiveDocuments`)
- [Codeunit 452 "Report Distribution Management"](../codeunit/452.md) (1 call: `VANDocumentReport → SendDocument`)
- [Table 60 "Document Sending Profile"](../table/60.md) (1 call: `CheckElectronicSendingEnabled → CheckServiceEnabled`)

## Recent changes

- 2026-09-22 [#11171 [Security][Hardening] Validate integration URLs stored in setup tables](../../changes/bcapps/11171.md) (main, BC30, fix)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-25, 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: "Doc. Exch. Service Mgt.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
