function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Robert Koch 18Robert Koch 18 

Slight change to Signer 2 in "Add Docusign Signer" apex class - Need to combine email and Name information from 2 users

I am testing a request to customize Signer 2 in my AddDocusignSigner apex class. The logic below works to add John Smith as Signer 2, so that the user John Smith gets an email sent to john.smith@testcompany.com. 

We got a request to keep the same email, but have the name of the CFO, Mary Jones in the Docusign envelope. 

So Signer 2 will have the name 'Mary Jones' and the email "john.smith@test company.com

I believe all that is needed is a slight change to lines 5 and 6 below. 

Can anyone help? Thank you!!!



1 public with sharing class AddDocusignSigner {
2
3   public static void addsigner(dsfs__DocuSign_Envelope__c[] newenvelope){
4
5 //Add John.
6 User cfouser = [select Id, Email, Name from User where Lastname ='Smith' and Firstname = 'John'];
7
8  dsfs__DocuSign_Envelope_Recipient__c nsign = new dsfs__DocuSign_Envelope_Recipient__c();
9  nsign.DSFS__DOCUSIGN_ENVELOPEID__C = newenvelope[0].Id;
10 nsign.DSFS__DSER_USERID__C = cfouser.Id;
11 nsign.DSFS__DOCUSIGN_RECIPIENT_ROLE__C = 'Customer 1';
12 nsign.DSFS__DOCUSIGN_SIGNATURE_NAME__C = cfouser.Name;
13  nsign.DSFS__DOCUSIGN_SIGNER_TYPE__C = 'Signer';
14  nsign.DSFS__ID_CHECK__C = FALSE;
15 nsign.DSFS__ROLENAME__C = 'Signer 2';
16  nsign.DSFS__ROUTING_ORDER__C = 2;
17 nsign.DSFS__SALESFORCE_RECIPIENT_TYPE__C = 'User';