Skip to main content
Participant
Jun 23, 2020 3:15 PM UTC
Question

Salesforce sending adobe sign agreements from apex.

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 is closed to new replies. Start a new post to keep the conversation going.

3 replies

Participant
Oct 10, 2020 6:29 PM UTC

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 😉

Translate
Participant
Oct 10, 2020 6:31 PM UTC

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).

Translate
fel1xp
Participant
Oct 25, 2022 2:28 PM UTC

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. 

Translate