---
id: object/codeunit/9560
type: object
title: Codeunit 9560 "Document Sharing"
summary: Codeunit 9560 "Document Sharing" in System Application (System.Integration). 6 public procedures, 5 events. Present since at least BC23, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - system application
versions:
  introduced: null
  last_changed: null
  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: a1e82c03188cb0de4593831023fd469e81cbef84c2e0a8088eb35158c982ee13
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Document%20Sharing/src/DocumentSharing.Codeunit.al
    title: src/System Application/App/Document Sharing/src/DocumentSharing.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: 9560
name: Document Sharing
namespace: System.Integration
app: System Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 11
  events: 5
  subscribers: 0
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 5
  calls: 1
  called_by: 17
  implements: 0
---

# Codeunit 9560 "Document Sharing"

> Codeunit 9560 "Document Sharing" in System Application (System.Integration). 6 public procedures, 5 events. Present since at least BC23, still in BC30.

System Application · System.Integration · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Document%20Sharing/src/DocumentSharing.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Public |
| TableNo | Document Sharing |

## Events published

- `OnUploadDocument(var DocumentSharing: Record "Document Sharing" temporary; var Handled: Boolean)` (integration): Raised when the document needs to be uploaded.
  - subscribers: [Codeunit 9510 "Document Service Management"](../codeunit/9510.md) OnUploadDocument
- `OnCanUploadDocument(var CanUpload: Boolean)` (integration): Raised to test if there are any document services that can handle the upload.
  - subscribers: [Codeunit 9510 "Document Service Management"](../codeunit/9510.md) OnCanUploadDocument
- `OnCanUploadSystemDocument(var CanUpload: Boolean)` (integration): Raised to test if there are any document services that can handle the upload for a system document.
  - subscribers: [Codeunit 9510 "Document Service Management"](../codeunit/9510.md) OnCanUploadSystemDocument
- `OnGetFileContents(var DocumentSharing: Record "Document Sharing" temporary; var Handled: Boolean)` (integration)
  - subscribers: [Codeunit 9510 "Document Service Management"](../codeunit/9510.md) OnGetFileContents
- `OnDeleteDocument(var DocumentSharing: Record "Document Sharing" temporary; var Handled: Boolean)` (integration)
  - subscribers: [Codeunit 9510 "Document Service Management"](../codeunit/9510.md) OnDeleteDocument

## Procedures

- `Share(var DocumentSharingRec: Record "Document Sharing")`: Triggers the document sharing flow.
- `Share(FileName: Text; FileExtension: Text; InStream: InStream; DocumentSharingIntent: Enum "Document Sharing Intent")`: Triggers the document sharing flow.
- `Share(FileName: Text; FileExtension: Text; InStream: InStream; DocumentSharingIntent: Enum "Document Sharing Intent"; DocumentSharingSource: Enum "Document Sharing Source")`: Triggers the document sharing flow.
- `ShareEnabled(): Boolean`: Checks if document sharing is enabled.
- `ShareEnabled(DocumentSharingSource: Enum "Document Sharing Source"): Boolean`: Checks if document sharing is enabled.
- `EditEnabledForFile(FileName: Text): Boolean`: Checks if Document can be edited online.

## Triggers

OnRun

## Relations

- runs on [Table 9560 "Document Sharing"](../table/9560.md)

## 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 9561 "Document Sharing Impl."](../codeunit/9561.md) (4 calls: `EditEnabledForFile → EditEnabledForFile`, `OnRun → (object)`, `Share → (object)`, …)

## Called by

- [Codeunit 9561 "Document Sharing Impl."](../codeunit/9561.md) (8 calls: `OnRun → OnCanUploadDocument`, `OnRun → OnCanUploadSystemDocument`, `OpenShare → (object)`, …)
- [Codeunit 1482 "Edit in Excel Impl."](../codeunit/1482.md) (3 calls: `DownloadExcelFile → Share`, `DownloadExcelFile → ShareEnabled`, `SetupFieldColumnBindings → ShareEnabled`)
- [Codeunit 9510 "Document Service Management"](../codeunit/9510.md) (3 calls: `InvokeDocumentSharingFlowFromMedia → (object)`, `OpenInOneDrive → Share`, `ShareWithOneDrive → Share`)
- [Codeunit 9988 "Word Template Impl."](../codeunit/9988.md) (2 calls: `EditDocumentAfterMerge → Share`, `EditDocumentAfterMerge → ShareEnabled`)
- [Page 1173 "Document Attachment Details"](../page/1173.md) (2 calls: `OnAfterGetCurrRecord → EditEnabledForFile`, `OnAfterGetCurrRecord → ShareEnabled`)
- [Page 1178 "Doc. Attachment List Factbox"](../page/1178.md) (2 calls: `UpdateActionsVisibility → EditEnabledForFile`, `UpdateActionsVisibility → ShareEnabled`)
- [Page 8889 "Email Attachments"](../page/8889.md) (2 calls: `OnAfterGetCurrRecord → EditEnabledForFile`, `OnAfterGetCurrRecord → ShareEnabled`)
- [Table 5077 "Segment Line"](../table/5077.md) (2 calls: `HandleTrigger → ShareEnabled`, `MaintainSegLineAttachment → ShareEnabled`)
- [Page 193 "Incoming Doc. Attach. FactBox"](../page/193.md) (1 call: `OnAfterGetRecord → ShareEnabled`)
- [Page 24 "Performance Profiler"](../page/24.md) (1 call: `OnOpenPage → ShareEnabled`)
- [Page 680 "Report Inbox"](../page/680.md) (1 call: `OnAfterGetCurrRecord → ShareEnabled`)
- [Page 681 "Report Inbox Part"](../page/681.md) (1 call: `OnAfterGetCurrRecord → ShareEnabled`)
- [Page 9650 "Custom Report Layouts"](../page/9650.md) (1 call: `OnAfterGetCurrRecord → ShareEnabled`)
- [Page 9660 "Report Layouts"](../page/9660.md) (1 call: `OnAfterGetCurrRecord → ShareEnabled`)
- [Page 9989 "Word Templates"](../page/9989.md) (1 call: `OnOpenPage → ShareEnabled`)
- [Page 9996 "Word Template Selection Wizard"](../page/9996.md) (1 call: `OnOpenPage → ShareEnabled`)
- [Page extension 9204 "User Settings"](../pageextension/9204.md) (1 call: `SetOneDriveLinkVisibilityAndText → ShareEnabled`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: none

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