0

I am sending a document using DocuSign envelope template in salesforce sandbox. I have given Document writeback to salesforce record option in my envelope template but the completed document not getting attached in notes and attachments related list of the source record.

Tried with different records and different envelopes.

2 Answers2

0

I believe it will write back to the files section by default, not notes and attachments. I'm assuming by your question you are utilizing APEX to send this envelope? Are you using .withOptions to tell your code where to write back the document? https://www.docusign.com/blog/developers/whats-new-summer-21-apex-toolkit

Tyler2P
  • 2,324
  • 26
  • 22
  • 31
0

With Apex, you can use the dfsle.Envelope.withOptions method in order to writeback combined documents under Salesforce.

To write back completed documents and update the Opportunity stage when an envelope is completed, you can use the following code:

myEnvelope.withOptions(new dfsle.Envelope.Options(
// Whether to populate auto-place tags for default roles
false,
new dfsle.Document.WriteBack(
// Where to link the completed document(s)
opportunityId,
// The completed document(s) file name format
dfsle.Document.WRITE_BACK_ENVELOPE_STATUS_PDF,
// Whether to combine all the documents into a single PDF
true,
// Whether to include the Certificate of Completion (CoC)
true),
// Envelope status event updates
new Map<String, Map<String, Object>> {
// Set Opportunity.StageName to "Closed Won" upon completion
dfsle.Envelope.STATUS_COMPLETED => new Map<String, Object> {
'Opportunity.StageName' => 'Closed Won'
}
},
// Recipient status event updates
new Map<String, Map<String, Object>>()));

You will find an example in this blog article: https://www.docusign.com/blog/developers/whats-new-summer-21-apex-toolkit

Ashley

DocuSign Developer Support