I have installed Docusign App Launcher in my Salesforce developer org. I am using the generate_and_convert REST API to generate the documents and then I am sending these documents using sendEnvelope method of EnvelopeService ApexToolkit.
I have the requirement of getting a list of documents as and when it comes and then updating them onto an Envelope and finally send the Envelope. For this I have created an empty envelope with a recipient and sent the Envelope with Boolean false.
Contact myContact = SELECT Id,FirstName,LastName,Email,Phone FROM Contact WHERE Name = 'Test Contact'];
dfsle.Envelope myEnvelope = dfsle.EnvelopeService.getEmptyEnvelope(new dfsle.Entity('mysourceId'))
.withRecipients(new List<dfsle.Recipient> {
dfsle.Recipient.fromSource(
myContact.FirstName + ' ' + myContact.LastName,
myContact.Email,
myContact.Phone,
'Signer 1',
new dfsle.Entity(myContact.Id))
});
myEnvelope = dfsle.EnvelopeService.sendEnvelope(myEnvelope, false);
Once this Envelope is saved in Docusign...I try updating the Envelope with my documents.
List<dfsle.Document> documentList = dfsle.DocumentService.getDocuments(ContentVersion.getSObjectType(), new Set<Id>{myDocId});
system.debug(myEnvelope1.docuSignId);
myEnvelope = dfsle.EnvelopeService.updateEnvelope(myEnvelope)
.withDocuments(documentList);
Once I finish with this I do sendEnvelope again. However I do not see the documents in Docusign.
Is this is the way how it should be done. or is there any other way that this can be achieved.
Thanks for your reply
Page 1 / 1
Hi
sendEnvelope(myEnvelope, false);
ApexToolkit creates the envelope as a Draft.
At this time ApexToolkit does not have an option to send Draft envelopes.
The only ways to send these are:
- Manually through the Docusign WebUI
- Direct update API call
- Sender View. You can get the Sender View URL through dfsle.EnvelopeService.getSenderViewUrl method. Please refer to the Apex Toolkit reference for more information about this method: https://developers.docusign.com/docs/salesforce/apex-toolkit-reference/envelopeservice.html
Reply
Sign up
Already have an account? Login
You can login or register as either a Docusign customer or developer. If you don’t already have a Docusign customer or developer account, you can create one for free when registering.
Customer Login/Registration Developer Login/RegistrationDocusign Community
You can login or register as either a Docusign customer or developer. If you don’t already have a Docusign customer or developer account, you can create one for free when registering.
Customer Login/Registration Developer Login/RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.