user3284160
user3284160

Reputation: 9

DocuSign for Salesforce.com

I have 2 users. I need to send the envelope to User 1 to sign. Once user 1 has signed the document, User 2 needs to get the envelope to sign the document.

I have written a Custom button on a Custom object where I am passing the envelop ID and Passing the users to whom the envelope will be sent along with the routingOrder, but the envelope is received by both the users. I was not able to find a proper document that could help me resolve the issue. Piece of javascript:

{!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=''; 
//*************************************************// 

//DocuSign Template
var DST=''; 
//Adding Notes & Attachments
var LA='1';
//Custom Recipient List
var CRL='[email protected];FirstName~user;LastName~1;Role~Signer 1;RoutingOrder~1,[email protected];LastName~user2;Role~Signer 2;RoutingOrder~2,LoadDefaultContacts~1';
//Custom Contact Role Map
var CCRM='Signer 1~Signer 1;Signer 2~Signer 2';
//Custom Contact Type Map
var CCTM='Signer 1~Signer 1;Signer 2~Signer 2';
//Custom Email Subject
var CES='{!CustomObject__c.Id} - Please eSign Vocus Sales Agreement';
//Custom Email Message
var CEM='I am sending you this request for your electronic signature, please review and electronically sign by following the link below.';
//Custom Envelop from Docusign
var DST = '00000000-33F0-4A8C-A8B2-00000000000';


//********* Page Callout (Do not modify) *********// 
window.location.href ="/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID={!CustomObject__c.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;
//*******************************************//

Please do let me know what I am missing out.

Thanks in advance for helping out.

Upvotes: 0

Views: 1526

Answers (1)

Kim Brandl
Kim Brandl

Reputation: 13500

Most likely an issue with how you're setting CCRM and CCTM. Try changing to this instead (replace ALL_CAPS_TEXT with appropriate Role Names from the DocuSign Template you're using):

//Custom Contact Role Map
var CCRM='Signer 1~ROLE_NAME_OF_FIRST_RECIPIENT_IN_DOCUSIGN_TEMPLATE;Signer 2~ROLE_NAME_OF_SECOND_RECIPIENT_IN_DOCUSIGN_TEMPLATE';

//Custom Contact Type Map
var CCTM='Signer 1~Signer;Signer 2~Signer';

Notice that in setting the value of CCTM, the second value in each entry should simply be "Signer" (as shown above).

Also, since you're using a DocuSign Template (DST), you should verify that the Recipient Routing Order is set appropriately there as well.

Here's a (working) example for a custom button that sends to the first recipient first, and then when that recipient completes the envelope, sends to the second recipient:

Recipient Role Names & Routing Order as Defined by the DocuSign Template that the custom button uses:

enter image description here

Custom button code:

{!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='';
 //*************************************************// 

//DocuSign Template 
var DST=''; 
//Adding Notes & Attachments 
var LA='1'; 
//Custom Recipient List 
var CRL='[email protected];FirstName~user;LastName~1;Role~Signer 1;RoutingOrder~1,[email protected];LastName~user2;Role~Signer 2;RoutingOrder~2,LoadDefaultContacts~1';
 //Custom Contact Role Map 
var CCRM='Signer 1~Customer;Signer 2~SalesRep'; 
//Custom Contact Type Map 
var CCTM='Signer 1~Signer;Signer 2~Signer'; 
//Custom Email Subject 
var CES='Please eSign Vocus Sales Agreement'; 
//Custom Email Message 
var CEM='I am sending you this request for your electronic signature, please review and electronically sign by following the link below.';
 //Custom Envelop from Docusign 
var DST = '7C350ABB-74F9-463E-96E3-49153AA25607'; 


//********* Page Callout (Do not modify) *********// 
window.location.href ="/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID={!Opportunity.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;
 //*******************************************//

This is the exact same button code that you provided in your question -- with only minor changes:

  • Changed email addresses in CRL (so I could test receiving the emails).
  • Changed CCRM to specify corrsponding Recipient Role Name from DocuSign Template for each signer.
  • Changed CCTM to use just "Signer" as the second portion for each item.
  • Changed DST to the ID of a Template in my DocuSign account (so I could test).
  • Updated window.location.href to use Opportunity.Id as SourceID (so I could test).

Upvotes: 1

Related Questions