global
Adobe Acrobat Sign for Salesforce: Developer Guide is designed to help Salesforce developers learn about the objects and parameters that are required to integrate your Salesforce package with Adobe Acrobat Sign.
Adobe Acrobat Sign for Salesforce objects may change in a future release. If you build a custom solution that depends on objects that are changed, you may be required to update your customization.
In v21 the order of updates has changed. Below is the sequence in which the agreement and its related objects are updated:
Starting from Acrobat Sign for Salesforce V 21.0, all asynchronous processes (which include automatic updates and data mappings) have been switched from future methods to queueable, an approach recommended by Salesforce.
With this change, all customizations in the subscriber organization that add jobs to the Salesforce queue as part of the auto-update or data mapping process will fail with an error "System.LimitException: Too many queueable jobs added to the queue: 2".
The failure happens because a queueable process can only add one child queueable job, which is already taken up by Acrobat Sign. For details, refer to Queueable Apex Limits.
Error: "When chaining jobs, you can add only one job from an executing job with System.enqueueJob, which means that only one child job can exist for each parent queueable job. Starting multiple child jobs from the same queueable job isn’t supported."
The above-stated error occurs when the agreement status does not change or the data mapping does not run correctly. To resolve this error, look for the offending trigger, process builder, or workflow and deactivate it or switch it to use a synchronous call or schedule it for later.
The agreement template service is exposed as a global Apex service by the managed package. This allows Apex code outside of the managed package to load agreements based on existing agreement templates. The class and all exposed methods are marked as global to allow such access.
The Apex service is exposed through the following invocation class: echosign_dev1.AgreementTemplateService
Loading an agreement template with e-Sign Library Templates is currently not supported. We suggest that you move the document templates to a Salesforce document library.
global |
static Id load() |
Loads an agreement using an agreement template marked as default and which has no master object type. |
global |
static Id load(String templateId) |
Loads an agreement using the specified agreement template ID, which has no master object type.
|
global |
static Id load(String templateId, String masterId) |
Loads an agreement using the specified agreement template ID and the specified master record ID, whose type must match the master object type configured in the specified agreement template. |
global |
static Id load(String templateId, String masterId, Map<String,AgreementTemplateVariable> agreementTemplateVariables) |
Loads an agreement using the specified agreement template ID and the specified master record ID, whose type must match the master object type configured in the specified agreement template. Also passes in the specified runtime variables as name value pairs.
|
global |
static List<AgreementTemplateService.AgreementTemplateBasicInfo> getAgreementTemplateList(AgreementTemplateListOptions options) |
Get a list of agreement templates based on filtering options. Return an empty list if no agreement template is the found with the filtering options. |
global |
static AgreementTemplateService.AgreementTemplateDetails getAgreementTemplateDetails(String templateId) |
Get agreement template details for the specified agreement template ID. Return an empty object if no agreement template found. |
global |
static String getAgreementTemplateUrl(String templateId) |
Get the url to edit the agreement template given the agreement template ID. |
global |
static String getNewAgreementTemplateUrl() |
Get the url to create a new Agreement Template in Adobe Sign. |
Access |
Signature |
---|---|
global |
AgreementTemplateListOptions() |
global |
AgreementTemplateListOptions(String masterObjectType, Boolean isActive, Boolean hasAttachment, Boolean hasRecipient, Boolean autoSend) |
Access |
Name |
---|---|
global |
masterObjectType |
global |
isActive |
global |
hasAttachment |
global |
hasRecipient |
global |
autoSend |
No filter is applied on its corresponding field when querying agreement templates if a field listed above has null value.
Access |
Name |
---|---|
global |
name |
global |
recordId |
global |
url |
global |
isDefault |
global |
daysUntilExpiration |
global |
language |
Access |
Name |
---|---|
global |
message |
global |
ccList |
global |
dataMappingName |
global |
mergeMappingName |
global |
url |
global |
recipients |
Access |
Name |
---|---|
global |
recipientRole |
global |
recipientType |
global |
recipientName |
global |
signOrder |
The echosign_dev1.AgreementTemplateVariable global class has two global fields.
Every method either return the ID of the newly created agreement record or throws an exception with a detailed error message if something went wrong during the load operation.
The Adobe e-Sign API template service is exposed as a global Apex service by the managed package. This allows Apex code outside of the managed package to invoke a set of Adobe e-Sign API's through these wrappers. The wrappers greatly simplify the API invocation because consumers do not need to create request and response data model. Also consumers do not need to handle the transformation of Salesforce data into e-Sign data models. Most of the complexity is abstracted from the consumer. For example, to send an agreement the consumer just passes in the agreement record ID, the service will handle querying it, extracting all of the relevant data, passing it on the API and parsing the result.
The class and all exposed methods are marked as global to allow such access.
The Apex service is exposed through the following invocation class: echosign_dev1.EchoSignApiService
global |
static void cancelDocument(Id agreementId) |
Cancels the agreement with the specified agreement ID. |
global |
static void delegateSigner(Id agreementId, String delegatedEmail) |
Delegate signing to the provided email. |
global |
static void delegateSigner(Id agreementId, String delegatedEmail, String message) |
Delegate signing to the provided email with the specified message. |
global |
static echosign_dev1.EchoSignApiService.DocumentInfo getDocumentInfo(Id agreementId) |
Retrieves detailed information for the specified agreement ID. |
global |
static List<EchoSignApiService.SigningUrl> getSigningUrls(Id agreementId) |
Retrieves all signing URL's for the specified agreement ID. |
global |
static void removeDocument(Id agreementId) |
Cancels the agreement with the specified agreement ID and deletes the agreement record in Salesforce (the agreement is not removed from the Adobe e-Sign account). |
global |
static void replaceSigner(Id replacementRecipientId) |
Replaces the specified signer. |
global |
static void replaceSigner(Id replacementRecipientId, String message) |
Replaces the specified signer with the specified message. |
global |
static echosign_dev1.EchoSignApiService. SendDocumentResult sendDocument(Id agreementId) |
Sends out the agreement with the specified agreement ID, returns the result with the document key and URL's. |
global |
static void sendReminder(Id agreementId) |
Sends a reminder to the current signer for the specified agreement ID. |
global | static void updateAgreement(Id agreementId) | Updates the agreement with the specified agreementId |
global | static EchoSignApiService.AgreementViewUrl getViewAgreementUrl(Id agreementId) |
Retrieves view/manage page from Sign for the specified agreement ID, which has a viewURL property. Note: For security reasons, the generated agreement URL only has a temporary lifespan so it generates a REST-HTTPS call to get a fresh URL from Adobe Sign services. |
Access |
Name |
---|---|
global |
String eventType |
global |
String participantEmail |
Access |
Signature |
---|---|
global |
DocumentHistoryEvent() |
Access |
Name |
---|---|
global |
Map<string,list> historyByEmail |
global |
Map participantsByEmail |
global |
Map participantsByName |
global |
String senderEmail |
global |
String status |
Access |
Signature |
---|---|
global |
DocumentInfo() |
Access |
Name |
---|---|
global |
String company |
global |
String email |
global |
String name |
global |
String status |
global |
String title |
Access |
Signature |
---|---|
global |
ParticipantInfo() |
Access |
Name |
---|---|
global |
String documentKey |
global |
Exception error |
global |
String url |
Access |
Signature |
---|---|
global |
SendDocumentResult() |
Access |
Name |
---|---|
global |
String email |
global |
String esignUrl |
global |
String simpleEsignUrl |
Access |
Signature |
---|---|
Global |
|
Exposes the main e-Sign agreement actions on a bulk level, allowing an operation to be performed on a set of agreements. This class implements the Salesforce Database.Batchable interface. It can process any number of records, which will be broken down into sets of 5 and processing each set as an individual transaction, which allows governor limits to be respected.
The Apex batch service is exposed through the following invocation class: echosign_dev1.EchoSignActionBatch
The following parameters must be specified to initialize a batch operation.
A list of the agreement record ID's on which to perform the provided action. The action to perform, one of the following supported values:
Current user session ID. Only required for an update action type.
Submitter user record, used to notify this user through an email once the bulk processing completes.
User submitterUser = UserInfo.getUserId();
EchoSignActionBatch batch = new EchoSignActionBatch( agreementIds, 'Remind', UserInfo.getSessionId(), submitterUser); syncProcessId = Database.executeBatch(batch, 5);
Takes in a SOQL query and an agreement template record ID. The query is executed to get a set of master object records, each of which is then run through the provided agreement template to generate an agreement record. This class implements the Salesforce Database.Batchable interface. It can process any number of records, which will be broken down into sets of 5 and processing each set as an individual transaction, which allows governor limits to be respected.
The record types returned by the SOQL query must match the provided agreement template master object type. For each record, the agreement template service is invoked.
The Apex batch service is exposed through the following invocation class:
echosign_dev1.AgreementTemplateBatch
The following parameters must be specified to initialize a batch operation.
SOQL query to execute, must contain the record ID as a selected field. Any other field is optional.
Agreement template record ID, which will be used in conjunction with the master record ID to load an agreement.
String agreementTemplateId = [SELECT Id from echosign_dev1__Agreement_Template__c where Name = 'Default Template']; String soqlQuery = 'SELECT Id from Contact where Account.IsActive = true';
AgreementTemplateBatch batch = new AgreementTemplateBatch(soqlQuery, agreementTemplateId); syncProcessId = Database.executeBatch(batch, 5);
Takes in a list of master object record ID's and the master object type, which are then queried, and each of which is then run through the provided agreement template to generate an agreement record. This class implements the Salesforce Database.Batchable interface. It can process any number of records, which will be broken down into sets of 5 and processing each set as an individual transaction, which allows governor limits to be respected.
The master object type provided must match the provided agreement template master object type. For each record, the agreement template service is invoked.
The Apex batch service is exposed through the following invocation class:
echosign_dev1.AgreementTemplateServiceBatch
The following parameters must be specified to initialize a batch operation.
String agreementTemplateId = [SELECT Id from echosign_dev1__Agreement_Template__c where Name = 'Default Template'];
AgreementTemplateBatch batch = new AgreementTemplateServiceBatch(new List<Id>{'01p50000000HoMB'}, agreementTemplateId, 'Contact');
syncProcessId = Database.executeBatch(batch, 5);
The agreement template service is exposed as a Salesforce REST web service by the managed package. This allows external systems outside of the Salesforce org to load agreements based on existing agreement templates. Please refer to the Creating REST APIs using Apex REST article for more details on how to access and invoke custom REST Apex services from within Salesforce. Invocations must provide a valid session ID for authentication and authorization.
The web service is exposed from the following URL:
https://<instance_name>.salesforce.com/services/apexrest/echosign_dev1/template/load/<template_id>?masterId=<master_id>&varName1=var Value1&varName2=varValue2
The last part of the URL is the ID of the agreement template record in the current Salesforce organization which should be used to load the agreement. This part of the URL is optional. If omitted, the agreement template marked as the default will be loaded. If the template ID is omitted and no default agreement template ID exists, an error will be returned.
The template ID can be in the 15 or 18 character format.
The masterId parameter specifies which master record should be used to load the agreement from the specific agreement template. This parameter is optional, but must be specified for any agreement template which specifies a master object type and references that master object in the template.
The master ID can be in the 15 or 18 character format.
Any additional parameters are used as runtime variables, as name-value pairs, used to populate any runtime variables specified in the agreement template.
The REST web service returns a LoadResult object which contains the following fields:
The background service capability allows package consumers to invoke various actions on an agreement object by updating the Background Action (echosign_dev1 Background_Actions c) field to the corresponding value. Once the field value is changed from a blank value or another value to one of the following values, the action is kicked off from a trigger that is part of the e-Sign managed package.
All of the actions execute in an asynchronous future mode, so the status will be stored in the Error field on the agreement.
Sign in to your account