2014-06-27 31 views
0

我有一個我創建的按鈕,但當帳戶名稱中包含&符號時,我遇到了問題。當添加&時,它會完全清除電子郵件主題的其餘部分。我試着添加一個JSENCODE,但沒有解決問題。有另一種方法可以讓這個工作起作用嗎?使用DocuSign自定義按鈕進行轉義和字符

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

//Adding Notes & Attachments 
var LA='0'; 

//Custom Email Subject 
var CES='Re: Agreement for On-Site Mobile Services from TestCompany, Inc.:'; 

//Custom Email Message 
var CEM='{!JSENCODE(Account.Name)}\\n{!Contact.Name}\\n{!JSENCODE(Contact.MailingStreet)}\\n{!Contact.MailingCity}, {!Contact.MailingState} {!Contact.MailingPostalCode}\\n\\nRe: Agreement for On-Site Mobile Services\\n\\nPlease find attached our Agreement for Services (agreement) for {!Opportunity.Account}. The Agreement outlines the services to be provided by TestCompany, fee schedule and our general terms and conditions for your review and electronic signature.\\n\\nOn behalf of TestCompany, we look forward to the opportunity to serve your organization.\\n\\n{!Opportunity.OwnerFullName}\\n{!Opportunity.OwnerTitle}\\nexaminetics\\n{!Opportunity.Owner_Street_Address__c}\\n{!Opportunity.Owner_Address__c}\\n{!Opportunity.OwnerPhone}\\n{!Opportunity.OwnerEmail}\\nwww.testcompany.com'; 


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

回答

6

&符號是ASCII集外的字符。由於自定義按鈕邏輯正在通過URL推送此數據,因此除了JSENCODE之外,請嘗試使用URLENCODING。

例如:{!用urlencode(JSENCODE(Account.Name))}

CEM =「

我建議你使用這個你所有的合併域

+0

不幸的是沒有幫助。它仍然切斷了電子郵件主題的其他部分,是否有某種類型的查找和替換黑客行爲我可以對該字符串執行操作?因此,如果字符串找到&,它會將其替換爲該詞並且? – user3582197

+0

沒關係,它可行! – user3582197