问题描述:

We currently have DocuSign integrated with Salesforce. When users use the custom DocuSign button the DocuSign process starts within the salesforce window. We'd like this whole thing to pop out into a new window. I found this article: https://www.docusign.com/supportdocs/dfs-admin-guide/Content/admin-guide/console-buttons.htm

But I'm not a coding expert and I was unable to implement it correctly. When I click the button I now receive a pop-up error from Chrome "Invalid left-hand side in assignment."

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

DocuSign_CreateEnvelope();

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

//*************************************************//

RSL = '4';

RROS = '1,2,3,4';

CES = '{!CanaryAMS__Policy__c.CanaryAMS__Contact_for_Policy__c}';

CCRM = 'Signer 1~Customer;Signer 2~CSR';

CCTM = 'Signer 1~Signer;Signer 2~Signer';

CRL = 'Email~{!CanaryAMS__Policy__c.contact_email__c};LastName~{!CanaryAMS__Policy__c.CanaryAMS__Contact_for_Policy__c};Role~Signer 1;RoutingOrder~1;AccessCode~{!CanaryAMS__Policy__c.DocuSignAccessCode__c},Email~{!$User.Email};Role~Signer 2;RoutingOrder~2;FirstName~{!$User.LastName};LastName~{!$User.FirstName},LoadDefaultContacts~1';

function inIframe () {

try {

return window.self !== window.top;

} catch (e) {

return true;

}

}

if(inIframe()){window.open("/apex/dsfs__DocuSign_CreateEnvelope?nw=1"+DSEID=0&SourceID={!CanaryAMS__Policy__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, "Popup", "location=1, status=1, scrollbars=1, resizable=1, directories=1, toolbar=1, titlebar=1, width=1200");

} else {

window.location.href="/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID={!CanaryAMS__Policy__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;

}

相关阅读:
Top