I am creating a custom docusign button on our opportunities object in salesforce and after i crafted the code i am receiving an error message "Unexpected token ~". No clue what this means. I can only hope i have something slightly off on my code. Here is the 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='';
//*************************************************//
// Modify individual options here://
// Recipient Starting Routing Order (default 1)//
RSRO = '1';
// Recipient Routing Order Sequential (default not sequential)//
RROS = '1';
// Custom Recipient List//
CRL = 'Email~anthony.m@playmakercrm.com;FirstName~Anthony;LastName~Miranda;Role~Signer 1;RoutingOrder~1;SignNow~1',
Email~;FirstName~;LastName~;Role~Signer 2;RoutingOrder~2;SignNow~1,
Email~john.g@playmakercrm.com;FirstName~John;LastName~Griscavage;Role~Signer 3;RoutingOrder~3;SignNow~0,
Email~anthony.m@playmakercrm.com;FirstName~Anthony;LastName~Miranda;Role~Signer 4;RoutingOrder3~;SignNow~,
Email~adam.bishop@playmakercrm.com;FirstName~Adam;LastName~Bishop;Role~Signer 5;RoutingOrder~3;SignNow~0,
Email~accounting@playmakercrm.com;FirstName~Accounting;LastName~Department;Role~Signer 6;RoutingOrder~3;SignNow~0,
Email~{!Opportunity.OwnerEmail};FirstName~{!Opportunity.OwnerFirstName};LastName~{!Opportunity.OwnerLastName};Role~Signer 7;RoutingOrder~3;SignNow~0,
Email~laura.mcdavid@playmakercrm.com;FirstName~Laura;LastName~McDavid;Role~Signer 8;RoutingOrder~3;SignNow~0;
// One Click Option (default edit envelope screen)//
OCO = 'Tag';
// Load Attachments (default on)//
LA = '1';
// Show Tag Button (default in config)//
STB = '1';
// Show Send Button (default in config)//
SSB = '1';
// Show Email Subject (default in config)//
SES = '1';
// Show Email Message (default in config)//
SEM = '1';
// Show Reminder/Expire (default in config)//
SRS = '1';
//********* 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="+CRC
L+"&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 appreciate any help someone can provide me here.
UPDATED CODE (Removed line breaks)
{!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='';
//*************************************************//
// Modify individual options here://
RSRO = '1';RROS = '1';CRL = 'Email~anthony.m@playmakercrm.com;FirstName~Anthony;LastName~Miranda;Role~Signer 1;RoutingOrder~1;SignNow~1',Email~;FirstName~;LastName~;Role~Signer 2;RoutingOrder~2;SignNow~1,Email~john.g@playmakercrm.com;FirstName~John;LastName~Griscavage;Role~Signer 3;RoutingOrder~3;SignNow~0,Email~anthony.m@playmakercrm.com;FirstName~Anthony;LastName~Miranda;Role~Signer 4;RoutingOrder3~;SignNow~,Email~adam.bishop@playmakercrm.com;FirstName~Adam;LastName~Bishop;Role~Signer 5;RoutingOrder~3;SignNow~0,Email~accounting@playmakercrm.com;FirstName~Accounting;LastName~Department;Role~Signer 6;RoutingOrder~3;SignNow~0,Email~{!Opportunity.OwnerEmail};FirstName~{!Opportunity.OwnerFirstName};LastName~{!Opportunity.OwnerLastName};Role~Signer 7;RoutingOrder~3;SignNow~0,
Email~laura.mcdavid@playmakercrm.com;FirstName~Laura;LastName~McDavid;Role~Signer 8;RoutingOrder~3;SignNow~0;OCO = 'Tag';LA = '1';STB = '1';SSB = '1';SES = '1';SEM = '1';SRS = '1';
//********* 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="+CRC
L+"&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 done just as Larry K suggested below and have updated the code. Now, the error message does not show up when i click the button. Nothing happens at all. It's almost like it is not firing.
{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")}
//********* Option Declarations (Do not modify )*********//var RC = '';var RSL='';var RSRO='';var RROS='';var CCRM='';var CCTM='';varCCNM='';var CRCL=''; var CRL='';var OCO='';var DST='';var LA='';var CEM='';varCES='';var STB='';varSSB='';var SES='';var SEM='';var SRS='';var SCS ='';varRES='';//*************************************************//
// Modify individual options here://RSRO = '1';RROS = '1';CRL = 'Email~anthony.m@playmakercrm.com;FirstName~Anthony;LastName~Miranda;Role~Signer 1;RoutingOrder~1;SignNow~1,Email~client@domain.com;FirstName~Client;LastName~Name;Role~Signer 2;RoutingOrder~2;SignNow~1,Email~john.g@playmakercrm.com;FirstName~John;LastName~Griscavage;Role~Signer 3;RoutingOrder~3;SignNow~0,Email~anthony.m@playmakercrm.com;FirstName~Anthony;LastName~Miranda;Role~Signer 4;RoutingOrder3~;SignNow~0,Email~adam.bishop@playmakercrm.com;FirstName~Adam;LastName~Bishop;Role~Signer 5;RoutingOrder~3;SignNow~0,Email~accounting@playmakercrm.com;FirstName~Accounting;LastName~Department;Role~Signer 6;RoutingOrder~3;SignNow~0,Email~{!Opportunity.OwnerEmail};FirstName~{!Opportunity.OwnerFirstName};LastName~{!Opportunity.OwnerLastName};Role~Signer 7;RoutingOrder~3;SignNow~0,Email~laura.mcdavid@playmakercrm.com;FirstName~Laura;LastName~McDavid;Role~Signer 8;RoutingOrder~3;SignNow~0'; OCO = 'Tag';LA = '1';STB = '1';SSB = '1';SES = '1';SEM = '1';SRS = '1';
//********* 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;
//*******************************************//
UPDATED CODE YET AGAIN. Removed all recipients except one from the Custom Recipeint List. Button still does not fire. It does nothing. could it be something else i am missing in salesforce?
Here is the updated code with only one recipient:
{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")}
//********* Option Declarations (Do not modify )*********//var RC = '';var RSL='';var RSRO='';var RROS='';var CCRM='';var CCTM='';varCCNM='';var CRCL=''; var CRL='';var OCO='';var DST='';var LA='';var CEM='';varCES='';var STB='';varSSB='';var SES='';var SEM='';var SRS='';var SCS ='';varRES='';//*************************************************//
// Modify individual options here://RSRO = '1';RROS = '1';CRL = 'Email~anthony.m@playmakercrm.com;FirstName~Anthony;LastName~Miranda;Role~Signer 1;RoutingOrder~1;SignNow~1'; OCO = 'Tag';LA = '1';STB = '1';SSB = '1';SES = '1';SEM = '1';SRS = '1';
//********* 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;
//*******************************************//