0

From X Object i have placed Send with DocuSign button From that X Object i have email field first recipient and another for user email so i need to add these both field as a recipient dynamically

Please can anyone help

3 Answers3

0

You may be able to use our embedded signing example (or similar code) to customize the button to your use case.

Paige Rossi
  • 261
  • 1
  • 3
0

You could use the recipient class for different methods and properties. https://developers.docusign.com/docs/salesforce/apex-toolkit-reference/recipient.html

You may also use this guide on how to use the Apex Toolkit to send responsive HTML documents with dynamically set tabs https://www.docusign.com/blog/developers/the-trenches-use-the-apex-toolkit-to-send-responsive-html-documents-dynamically-set

YaraK
  • 1
0

Are you still experiencing issues with this? Or did you find a solution?

As YaraK mentioned, you can use the Apex Toolkit and some custom logic to dynamically control the number of recipients.

But if you're looking for something more out-of-the-box with DocuSign eSignature for Salesforce, then there are a couple of options:

  1. Create 2 Envelope Template Configurations, each of which with a different recipient workflow, which will then create 2 separate custom buttons; one for each version of your use case workflow. Then use Lightning Dynamic Actions to setup logic to control which button is shown to your users.

  2. Create a URL custom button with a URLFOR script that creates the envelope in a dynamic way. You'd use the CRL, CCRM, and CCTM parameters (https://support.docusign.com/s/document-item?language=en_US&bundleId=srl1586134368658&topicId=nxl1649872087756.html&_LANG=enus) to define your recipient list, role mapping, and type mapping. You don't have to hard code the actual string values for each parameter, instead you could provide salesforce API merge field syntax to pull in the values from Salesforce fields.

For example, let's say you create a Formula field on your source object called "DocuSign_CRL__c" and you create the formula to evaluate some conditions then generate the actual portion of the CRL script such as 'Email~example@example.com;FirstName~John;LastName~Doe;Role~Signer 1'. You can also use Salesforce Apex or Flow to populate text fields with those values. You'd then repeat that process for every dynamic piece of your script needed. But then you'd pass through those API field names into your button.

Then your button script would look something like:

{!URLFOR('/apex/dsfs__DocuSign_CreateEnvelope', null, [
SourceID=YourSourceObjectNameHere.Id,
CRL='' + YourObject.DocuSign_CRL__c + '',
CCRM='' + YourObject.DocuSign_CCRM__c + '',
CCTM='' + YourObject.DocuSign_CCTM__c + ''
]
)}

I hope that helps at least provide a couple solutions to consider in the future!

Jesse
  • 27
  • 5