Skip to main content
Participant
June 23, 2020
Question

Salesforce sending adobe sign agreements from apex.

  • June 23, 2020
  • 1 reply
  • 1283 views

Steps followed:

1. Installed adobe sign app(from app exchange) in salesforce.

2. Created adobe trial account and linked that account in salesforce.

3. Created aggrement template with contact as master object and had set the runtime variable as "myRecipient".

 

https://helpx.adobe.com/sign/using/salesforce-integration-developer-guide.html

As per the above documentation I am trying to load the aggrement inorder to send the same to the dynamic receipent.

 

Documentation says :

static Id load(String templateId, String masterId, Map<String,AgreementTemplateVariable> agreementTemplateVariables)

 

templateId = Aggrement template record Id;

masterId = As per my logic I am passing the contact record ID

agreementTemplateVariables = This map am not sure how to frame.

 

I do know thatAgreementTemplateVariable works as name,value pair.

myRecipient = xxx@gmail.com;

 

Working code snippet:

echosign_dev1.AgreementTemplateService.load('templateID','MasterRecordID', ?????);

 

Please do let me know what I am missing.

 

Thank you inadvance !!

This topic has been closed for replies.

1 reply

Participant
October 10, 2020

Exactly. They don't provide sample code. However it is just a Map of String (Not sure what this String is supposed to be) to NameSpace.AgreementTemplateVariable('name','value'). 

 

Adobe support would charge for this Answer 😉

Participant
October 10, 2020

Sample code

Map<String,echosign_dev1.AgreementTemplateVariable> agreementTemplateVariables = new Map<String,echosign_dev1.AgreementTemplateVariable>();
agreementTemplateVariables.put('estimatedRate',new echosign_dev1.AgreementTemplateVariable('estimatedRate','1000'));

 

Although the Adobe Documentation does not talk about the Key (String).

fel1xp
Participant
October 25, 2022

Thanks Anup1549! Really helpful.


If everyone else is struggling with something similar the full code snippet for execute anonymous looks like this: 

 

try{
Map<String,echosign_dev1.AgreementTemplateVariable> agreementTemplateVariables = new Map<String,echosign_dev1.AgreementTemplateVariable>();
agreementTemplateVariables.put('myAttachment',new echosign_dev1.AgreementTemplateVariable('myAttachment','attachmentId'));

echosign_dev1.AgreementTemplateService.load('templateId','masterId', agreementTemplateVariables);
} catch (Exception e) {
system.debug(e.getMessage());
}

 

 

Just substitute: MasterId, TemplateId and AttachmentId for values from Salesforce.