+ Start a Discussion
Edward VazquezEdward Vazquez 

OnClick JavaScript Unexpected Identifier error. Button works fine for all other records expcept this one. Any ideas?

Only get this error for this specific record.
Best Answer chosen by Edward Vazquez
Neetu_BansalNeetu_Bansal
Hi Edward,

There might be some special characters in this particualar record that is causing the error, as a best practice use {!JSENCODE(text)} function before adding any data into url.

Let me know, if you need any other help.

Thanks,
Neetu

All Answers

Alexander TsitsuraAlexander Tsitsura
Hi Edward,

Can you share you js code, which u you use for button?

Thanks, Alex
Edward VazquezEdward Vazquez
Here it is. Thanks in advance for your help.

{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")}
DocuSign_CreateEnvelope();

//********* Option Declarations *********//
var
RC = '',
RSL = '',
RSRO = '',
RROS = '',
CCRM = '',
CCTM = '',
CCNM = '',
CRCL = '',
CRL = 'Email~xxx@xxxxxxxx.com;LastName~{!Properties__c.Acquisitions_Analyst_Name__c};Role~Signer 1;RoutingOrder~2;RecipientNote~All Residents have signed.,Email~{!Properties__c.Main_Resident_Email__c};LastName~{!Properties__c.Resident_Name__c};Role~Signer 2;RoutingOrder~1,Email~{!Properties__c.Resident_2_Email__c};LastName~{!Properties__c.Resident_2_Name__c};Role~Signer 3;RoutingOrder~1,Email~{!Properties__c.Resident_3_Email__c};LastName~{!Properties__c.Resident_3_Name__c};Role~Signer 4;RoutingOrder~1,Email~{!Properties__c.Resident_4_Email__c};LastName~{!Properties__c.Resident_4_Name__c};Role~Signer 5;RoutingOrder~1,'
OCO = 'Tag',
DST = '',
LA = '',
CEM = 'Hello, \\n \\n Please review the Lease Documents and follow the prompts to electronically sign the documents.  To review the Lease Documents, please click on the button labeled, Review Document.  Please note that you do not have to setup a DocuSign account in order to access the Lease Documents. \\n \\n Please complete this and have the certified funds in by: {!DATEVALUE(NOW()+2)}. \\n \\n There are NO exceptions to this date.  If we do not receive confirmation that the lease documents have been signed and the deposit received by the date specified above, we will terminate the contract and you will be disqualified from the program. \\n \\n We currently have your move in date scheduled for {!Properties__c.Actual_Move_In_Date__c}. \\n \\n The amount due is {!Properties__c.Security_Deposit_Logic__c} which represents the security deposit NOT including the pet deposit (if necessary).  Your prorated rental amount will be due in 72 hours prior to your move in date.  After we close, Pathlight, our property manager will reach out to you with payment details once your account is setup.  \\n \\n PLEASE MAKE YOUR DEPOSIT CHECK PAYABLE TO STEWART TITLE.  This check must be in certified funds or money order. \\n \\n NO PERSONAL CHECKS \\n \\n Please OVERNIGHT via FedEx or UPS to: \\n \\n Home Partners of America \\n 180 N. Stetson Ave. \\n Suite 3650 \\n Chicago, IL 60601 \\n \\n (IL ONLY) NOTICE! If you are dropping off documents or your deposit to our office:  \\n Please email leasing@homepartners.com with the date and time you will be arriving.  \\n \\n Thanks in advance!',
CES = 'Lease Docs for {!Properties__c.Full_Property_Address__c}',
STB = '0',
SSB = '1',
SES = '1',
SEM = '1',
SRS = '0',
SCS = '0',
RES = '1,1,1,1,100,1';

//********* Page Callout (Do not modify) *********//
window.location.href =
"/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID={!Properties_Document__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;
//*******************************************//
Neetu_BansalNeetu_Bansal
Hi Edward,

There might be some special characters in this particualar record that is causing the error, as a best practice use {!JSENCODE(text)} function before adding any data into url.

Let me know, if you need any other help.

Thanks,
Neetu
This was selected as the best answer
Edward VazquezEdward Vazquez
Thank you that solved my issue. Thanks again.