DocuSign for Salesforce -Open in new window

Rahul Sharma 76 Reputation points
2022-12-14T07:37:38.783+00:00

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 have started salesforce administrator training, But I can't able to solve this code.

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;  
}  
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,771 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more