Using the class “DocumentUploader”
Use different functions in the dvelop_docs_dev.DocumentUploader class to upload Salesforce files (ContentDocument, Attachment and EmailMessage) items to the connected document management system (DMS) using your custom Apex code.
Signature
global with sharing class DocumentUploader extends SubscriberInterface
Superclass
Using the “SubscriberInterface” class
Contents
Constructors
You can create an instance of DocumentUploader with the following constructors:
DocumentUploader()
This constructor creates a DocumentUploader instance with default values.
Signature
global DocumentUploader()
Methods
The class DocumentUploader provides the following methods:
Note
You can find more information on the superclass methods at Using the “SubscriberInterface” class.
getAttributesFromConfig(recordId, doctypeKey, filename)
Use this method to calculate the properties for a document that you want to upload based on the configured global settings. The settings are defined by the object type for the transferred record ID and the document type.
Signature
global List<DocumentAttribute> getAttributesFromConfig(Id recordId, String doctypeKey, String filename)
Parameters
recordId: The record ID. The ID determines the calculated properties and their source (record) using the global settings in combination with the document type.
Data type: Id
doctypeKey: The document type key, which predefines the calculated properties based on the global settings.
Data type: String
filename: An optional file name that is used as the source value for object mapping of the File name at run time type. If the file name is irrelevant, zero is transferred.
Data type: String
startUpload(requests, ?options)
Use this method to upload different records (for example, ContentDocument, Attachment or EmailMessage) items to d.velop documents. Define the upload parameters using different types of upload requests.
Warning
This method starts an asynchronous queueable process with System.enqueueJob(). Note the limits for queueable jobs in the context in which you use the method.
Signature
global Id startUpload(List<IDocumentUploadRequest> requests)
global Id startUpload(List<IDocumentUploadRequest> requests, DocumentUploadOptions options)
Parameters
requests: A list of upload requests that define the upload frame parameters. Depending on the type of request, either single or multiple files are uploaded.
Data type: List<dvelop_docs_dev.IDocumentUploadRequest>
options: An optional collection of settings that can control the behavior of the upload process.
Data type: dvelop_docs_dev.DocumentUploadOptions
Returned entry
The ID of the process’s queueable job.