DocuSign for Salesforce - 在新窗口中打开

时间:2016-11-01 16:55:36

标签: javascript salesforce docusignapi

我们目前将DocuSign与Salesforce集成在一起。当用户使用自定义DocuSign按钮时,DocuSign流程在salesforce窗口内启动。我们希望这一切都能弹出一个新窗口。我发现了这篇文章:https://www.docusign.com/supportdocs/dfs-admin-guide/Content/admin-guide/console-buttons.htm

但我不是编码专家,我无法正确实施。当我点击按钮时,我现在收到来自Chrome的弹出错误“分配时左侧无效。”

{!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;
}

0 个答案:

没有答案