You need to sign in to do that
Don't have an account?
Bailey Rudd
A problem with the OnClick JavaScript for this button or link was encountered: Unexpected token ILLEGAL
Hello,
I have created a custom button on the Quote layout that selects a certain template automatically. Except I'm receiving this error when clicked:
A problem with the OnClick JavaScript for this button or link was encountered:
Unexpected token ILLEGAL
Here is the code:
I have created a custom button on the Quote layout that selects a certain template automatically. Except I'm receiving this error when clicked:
A problem with the OnClick JavaScript for this button or link was encountered:
Unexpected token ILLEGAL
Here is the code:
var pdfOverlay = QuotePDFPreview.quotePDFObjs['quotePDFOverlay']; pdfOverlay.dialog.buttonContents='<input value="Save to Quote" class="btn" name="save" onclick="QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').SavePDF(\'0,\'0\');" title="Save to Quote" type="button"/><input value="Save and Email Quote" class="btn" name="saveAndEmail" onclick="QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'1\');" title="Save and Email Quote" type="button" /><input value="Cancel" class="btn" name="cancel" onclick="QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').close();" title="Cancel" type="button"/>; pdfOverlay.summlid="0EHo0000001E982"; pdfOverlay.setSavable(true); pdfOverlay.setContents('\quoteTemplateDataViewer.apexp?id={!(Quote.Id)}','/quote/quoteTemplateHeaderData.apexp?id={!(Quote.Id)}'); pdfOverlay.display();
Can you try changing this
pdfOverlay.setContents('\quoteTemplateDataViewer.apexp?id={!(Quote.Id)}','/quote/quoteTemplateHeaderData.apexp?id={!(Quote.Id)}');
to this
pdfOverlay.setContents('/quoteTemplateDataViewer.apexp?id={!(Quote.Id)}','/quote/quoteTemplateHeaderData.apexp?id={!(Quote.Id)}');
or this
pdfOverlay.setContents('/quote/quoteTemplateDataViewer.apexp?id={!(Quote.Id)}','/quote/quoteTemplateHeaderData.apexp?id={!(Quote.Id)}');
All Answers
Could it be that you're missing a single quote before the semi-colon at line 07?
.... title="Cancel" type="button"/>';
Same error after adding a single quote to line 07 before semi-colon. Any other suggestions?
For example go to the beginning of line 02 and hit the backspace key. Then press the space bar to remove the next line. Do this for all lines.
I get the summlid ID by the quote templates edit page in the URL, correct? Not sure what it doesn't like here....
Can you try changing this
pdfOverlay.setContents('\quoteTemplateDataViewer.apexp?id={!(Quote.Id)}','/quote/quoteTemplateHeaderData.apexp?id={!(Quote.Id)}');
to this
pdfOverlay.setContents('/quoteTemplateDataViewer.apexp?id={!(Quote.Id)}','/quote/quoteTemplateHeaderData.apexp?id={!(Quote.Id)}');
or this
pdfOverlay.setContents('/quote/quoteTemplateDataViewer.apexp?id={!(Quote.Id)}','/quote/quoteTemplateHeaderData.apexp?id={!(Quote.Id)}');
I'm glad it worked.