Codeunit "Document Sharing"
Codeunit to invoke document sharing flow.
Properties
| Name | Value |
|---|---|
| Access | Public |
| TableNo | Table System.Integration."Document Sharing" |
Methods
Share
Triggers the document sharing flow.
procedure Share(var DocumentSharingRec: Record "Document Sharing" temporary)
Parameters
| Name | Type | Description |
|---|---|---|
| DocumentSharingRec | Table System.Integration."Document Sharing" |
The record to invoke the share with. |
Examples
TempDocumentSharing.Name := 'My Shared Document.pdf'; TempDocumentSharing.Extension := '.pdf'; TempDocumentSharing.Data := "Document Blob"; TempDocumentSharing.Insert(); DocumentSharing.Share(TempDocumentSharing);
Share
Triggers the document sharing flow.
procedure Share(FileName: Text, FileExtension: Text, InStream: InStream, DocumentSharingIntent: Enum "Document Sharing Intent")
Parameters
| Name | Type | Description |
|---|---|---|
| FileName | Text |
Specifies the file name of the document (without file extension). It should only include valid filename characters. |
| FileExtension | Text |
Specifies the file extension (e.g. '.pdf'). |
| InStream | InStream |
Specifies the data to be shared (e.g. a report pdf). |
| DocumentSharingIntent | Enum System.Integration."Document Sharing Intent" |
Specifies the sharing intent of the document. |
Share
Triggers the document sharing flow.
procedure Share(FileName: Text, FileExtension: Text, InStream: InStream, DocumentSharingIntent: Enum "Document Sharing Intent", DocumentSharingSource: Enum "Document Sharing Source")
Parameters
| Name | Type | Description |
|---|---|---|
| FileName | Text |
Specifies the file name of the document (without file extension). It should only include valid filename characters. |
| FileExtension | Text |
Specifies the file extension (e.g. '.pdf'). |
| InStream | InStream |
Specifies the data to be shared (e.g. a report pdf). |
| DocumentSharingIntent | Enum System.Integration."Document Sharing Intent" |
Specifies the sharing intent of the document. |
| DocumentSharingSource | Enum System.Integration."Document Sharing Source" |
Specifies the sharing source of the document. |
ShareEnabled
Checks if document sharing is enabled.
procedure ShareEnabled(): Boolean
Returns
| Type | Description |
|---|---|
| Boolean |
Returns true if sharing is enabled, false otherwise. |
ShareEnabled
Checks if document sharing is enabled.
procedure ShareEnabled(DocumentSharingSource: Enum "Document Sharing Source"): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| DocumentSharingSource | Enum System.Integration."Document Sharing Source" |
Specifies the sharing source of the document. |
Returns
| Type | Description |
|---|---|
| Boolean |
Returns true if sharing is enabled, false otherwise. |
EditEnabledForFile
Checks if Document can be edited online.
procedure EditEnabledForFile(FileName: Text): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| FileName | Text |
File name of document. Ex 'Document.docx' |
Returns
| Type | Description |
|---|---|
| Boolean |
True if Document can be edited online. |
Events
OnUploadDocument
Raised when the document needs to be uploaded.
[IntegrationEvent(False,False)]
internal procedure OnUploadDocument(var DocumentSharing: Record "Document Sharing" temporary, var Handled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| DocumentSharing | Table System.Integration."Document Sharing" |
The record containing the document to be shared. |
| Handled | Boolean |
Specifies whether the event has been handled and no further execution should occur. |
OnCanUploadDocument
Raised to test if there are any document services that can handle the upload.
[IntegrationEvent(False,False)]
internal procedure OnCanUploadDocument(var CanUpload: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| CanUpload | Boolean |
Specifies whether there is a subscriber that can handle the upload. |
OnCanUploadSystemDocument
Raised to test if there are any document services that can handle the upload for a system document.
[IntegrationEvent(False,False)]
internal procedure OnCanUploadSystemDocument(var CanUpload: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| CanUpload | Boolean |
Specifies whether there is a subscriber that can handle the upload. |
OnGetFileContents
[IntegrationEvent(False,False)]
internal procedure OnGetFileContents(var DocumentSharing: Record "Document Sharing" temporary, var Handled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| DocumentSharing | Table System.Integration."Document Sharing" | |
| Handled | Boolean |
OnDeleteDocument
[IntegrationEvent(False,False)]
internal procedure OnDeleteDocument(var DocumentSharing: Record "Document Sharing" temporary, var Handled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| DocumentSharing | Table System.Integration."Document Sharing" | |
| Handled | Boolean |