0
votes

I have what should be a very simple straightforward custom button with the following goals.

  • Recipient 1 is the sender. (aka the Salesforce user pressing the button)
  • Recipient 2 is the client.

The button code is as follows:

{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")}

//********* Option Declarations (Do not modify )*********// 
var RC = '';var RSL='';var RSRO='';var RROS='';var CCRM='';var CCTM='';var CCNM='';var CRCL=''; var CRL='';var OCO='';var DST='';var LA='';var CEM='';var CES='';var STB='';var SSB='';var SES='';var SEM='';var SRS='';var SCS ='';var RES='';
//*************************************************//

DST = '--- TEMPLATE GUID REMOVED FOR EXAMPLE CODE ---';
CCRM = 'Internal~Internal;Client~Client';
CCTM = 'Internal~Signer;Client~Signer';
CRL = 'Email~{!User.Email};LastName~{!User.LastName};Role~Internal;Email~{!Lead.Email};LastName~{!Lead.LastName};Role~Client;';
alert(CRL);
CES = 'Test Email Subject';

//********* Page Callout (Do not modify) *********// 
window.location.href = "/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0 &SourceID={!Lead.Id}&RC="+RC+"&RSL="+RSL+"&RSRO="+RSRO+"&RROS="+RROS+" &CCRM="+CCRM+"&CCTM="+CCTM+"&CRCL="+CRCL+"&CRL="+CRL+"&OCO="+OCO+" &DST="+DST+"&CCNM="+CCNM+"&LA="+LA+"&CEM="+CEM+"&CES="+CES+" &SRS="+SRS+"&STB="+STB+"&SSB="+SSB+"&SES="+SES+"&SEM="+SEM+" &SRS="+SRS+"&SCS="+SCS+"&RES="+RES; 
//*******************************************//

I have ensured that the roles align between the DocuSign template, Salesforce, and the CCRM & CCTM variables. (See the following two images.)

DocuSign Roles

...............enter image description here

Salesforce Roles

...............enter image description here

alert(CRL) produces the following output which shows me the variable CRL is getting the right information.

enter image description here

However, at the next page the first recipient is dropped and the 2nd recipient is labeled as the first recipient with the role "Client". (See image below.)

enter image description here

The documentation here specifies the following..

The RoutingOrder is ignored if the “DocuSign Template” option is added.

Although, adding the routing order attribute to the CRL variable produces the same output as above except the 2nd recipient is properly labeled as recipient 2 with the first recipient omitted.

What do I need to do to properly map the Salesforce user pressing the custom button as the 1st recipient of the document with the role "Internal"?

1

1 Answers

0
votes

Upon further research I had a minor syntax error in the following line.

CRL = 'Email~{!User.Email};LastName~{!User.LastName};Role~Internal;Email~{!Lead.Email};LastName~{!Lead.LastName};Role~Client;';

Recipients in the Custom Recipients List must be separated by a comma.

If you look closely enough I accidentally used a semicolon for the separation of recipients.

The corrected line of code is:

CRL = 'Email~{!User.Email};LastName~{!User.LastName};Role~Internal,Email~{!Lead.Email};LastName~{!Lead.LastName};Role~Client;';