function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
APatAPat 

Calling a java script function

Hi,

 

We have customized the Quote PDF preview button. So basically, I have added a new Button to my Quote preview window. I call it as "Call Test Function". On click of this button, I call my java script function. However when i click the button, I get an java script error which says "Object Expected"... Not sure what that means...

 

Can someone please advice how to proceed ahead.

 

 The code is given below.

 

javascript: var pdfOverlay = QuotePDFPreview.quotePDFObjs['quotePDFOverlay'];

 

function test(){
alert('hello');
}

 

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\"  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\" />

<input value=\"Call TEST function\"  class=\"btn\" name=\"cancel\"
onclick=\"test();\"
title=\"CallTest\" type=\"button\" />';

sfdcfoxsfdcfox

It means there's a screwed up piece of code. pdfOverlay.dialog may not be a real object (so check your other related code).