DocumentService
global with sharing class DocumentService
Description
This class is the entry point for Docusign eSignature envelope document management. It provides methods to retrieve Salesforce source documents.
Methods
getDocumentFolders
global static Document.Folders getDocumentFolders(final SObjectType type)
Description
Retrieves a list of Salesforce source documents folders by object type. The current user's personal folder, and the documents contained within, is always returned as the first element in the list. The returned folder IDs may be used in subsequent calls to
dfsle.DocumentService.getFolderDocuments. By default, the Salesforce Document and ContentVersion types are supported. More types may be supported via plugins.
Returns
A list of document folders.
Parameters
typefinal SObjectType type
The Salesforce object type.
See
dfsle.DocumentService.getFolderDocuments
getDocuments
Description
Retrieves a list of Salesforce source documents by IDs.
By default, the Salesforce Document and ContentVersion types are supported. More types may be supported via plugins.
Returns
A list of envelope documents.
Parameters
typefinal SObjectType type
The Salesforce object type.
sObjectIds final Set<Id> sObjectIds
The Salesforce object IDs.
getEnvelopeDocuments
getFolderDocuments
Description
Retrieves a list of Salesforce source documents by folder IDs. The folder IDs may be retrieved by calling
dfsle.DocumentService.getDocumentFolders first. By default, the Salesforce Document and ContentVersion types are supported. More types may be supported via plugins.
Returns
A list of documents contained within the target folders.
Parameters
typefinal SObjectType type
The Salesforce object type.
folderIds final Set<Id> folderIds
The folder IDs.
See
dfsle.DocumentService.getDocumentFolders
getLinkedDocuments
global static List<Document> getLinkedDocuments(final SObjectType type, final Set<Id> linkedEntityIds, final Boolean getLastUpdatedOnly)
Description
Retrieves a list of Salesforce source documents by linked entity IDs.
For example, to pull in all of an Opportunity's Notes and Attachments related list:
List<dfsle.Document> docs = dfsle.DocumentService.getLinkedDocuments(
ContentVersion.getSObjectType(),
new Set<Id> { myOpportunity.Id },
false);
By default, only ContentVersion types are supported. More types may be supported via plugins.
Returns
A list of Docusign envelope documents.
Parameters
typefinal SObjectType type
The Salesforce object type.
linkedEntityIds final Set<Id> linkedEntityIds
The Salesforce parent IDs.
getLastUpdatedOnly final Boolean getLastUpdatedOnly
Whether to retrieve only the last updated linked document.