Download documents by code from Document Central
Document Central can be extended with code to enable downloading documents from a Document Central entry. The following documentation explains how to create an extension that allows you to download documents from a Document Central entry via code.
The following requirements must be met:
- Document Central must be present in the extension for reference.
Download file:
The DownloadFile function downloads a document by code.
Overload 1:
| Var | Name | Data Type | Subtype | Length | Description |
|---|---|---|---|---|---|
| No | ParamRecordSIMDMSDocumentEntry | Record | "SIM_DMS Document Entry" | The Document Central document entry that is downloaded | |
| No | ParamDownloadInAppContext | Boolean | Defines whether the download is performed in the App Context or in the User Context |
The function outputs:
| Name | Data Type | Length | Description |
|---|---|---|---|
| ReturnBase64FileText | Text | The downloaded document as Base64 |
Code Example:
In this example, a document that has been stored on the customer 01121212 and the file name 103035.pdf is downloaded with an App context.
Download file version:
The DownloadFileVersion function downloads a document by code.
Overload 1:
| Var | Name | Data Type | Subtype | Length | Description |
|---|---|---|---|---|---|
| No | ParamRecordSIMDMSDocumentEntryVersion | Record | "SIM_DMS Document Entry Version" | The Document Central document Version entry that is downloaded |
Overload 2:
| Var | Name | Data Type | Subtype | Length | Description |
|---|---|---|---|---|---|
| No | ParamRecordSIMDMSDocumentEntryVersion | Record | "SIM_DMS Document Entry Version" | The Document Central document Version entry that is downloaded | |
| No | ParamDownloadInAppContext | Boolean | Defines whether the download is performed in the App Context or in the User Context |
The function outputs:
| Name | Data Type | Length | Description |
|---|---|---|---|
| ReturnBase64FileText | Text | The downloaded document as Base64 |
Code Example:
In this example, the second version of the document that has been stored on the customer 01121212 and the file name 103035.pdf is downloaded with an App context.