javascript - Escape & character with DocuSign Custom Button -
i have button created i'm having issues working when account name has & symbol in it. when & added, clears out rest of email subject. tried adding jsencode , didn't solve problem. there way can work?
{!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 on-site mobile services 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 on-site mobile services\\n\\nplease find attached our agreement services (agreement) {!opportunity.account}. agreement outlines services provided testcompany, fee schedule , our general terms , conditions review , electronic signature.\\n\\non behalf of testcompany, forward opportunity serve 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; //*******************************************//
ampersands characters outside ascii set. since custom button logic pushing data through url, try urlencoding in addition jsencode.
example:
cem="{!urlencode(jsencode(account.name))}
i recommend applying merge fields.
Comments
Post a Comment