查询DocuSign中的自定义按钮

时间:2018-11-06 17:38:04

标签: docusignapi soql

我写了一个不起作用的简单代码,有人知道吗?

我收到此错误:“此按钮或链接的OnClick JavaScript出现问题: 意外的EOF”

我想通过机会中的自定义按钮从联系人中获取信息。为此,我要通过SOQL中的查询来获取信息。

这是代码:

{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")} 
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}

var ContactSQL = "SELECT Contact.Name, Contact.Email
FROM OpportunityContactRole
WHERE OpportunityId = '{!Opportunity.Id}'
LIMIT 1";
var ContactData = sforce.connection.query(ContactSQL);
var ContactTable = ContactData.getArray("records");
var ContactName = ContactTable[0].Contact.Name;
var ContactEmail = ContactTable[0].Contact.Email;


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

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

CRL = 'Email~'+ContactEmail+';LastName~'+ContactName+';Role~Signer 1'
CRL = CRL + ',Email~blabla@gmail.com;FirstName~Bla;LastName~Bla;Role~Signer 2;'

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

非常感谢!

0 个答案:

没有答案