• Kailash Sati
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I am not sure how to write a OnClick JavaScript custom close button on case object.

When the user clicks on this custom button, the following fields need to be updated with the given values.

Fields on case object:
Product Family = Unknown        
Product Model = Unknown
Problem Code = Non-Technical
Resolution Code = Spam
Status = Closed
Resolution Description = Spam
Account Name (lookup field) =  Unclassified Customer – Minnetonka 

Also need to associate the contact to the account; Unclassified Customer – Minnetonka


I appreciate the help!

Beth
I have created a List JS button in Opportunity Page > Quote Related List to generate Quote PDF for the selected Quote record. I get PdfOverlay undefined and after that a message is displayed "Cannot read Property 'dialog' of undefined. Below is my code:-

{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/14.0/apex.js")}

records = {!GETRECORDIDS($ObjectType.Quote)};
alert('records > ' + records);
var selectedRecords = [records];
alert('selectedRecords>' + selectedRecords);


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

alert('pdfOverlay > ' + pdfOverlay);

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



 //change this to use the correct template for your business/environment!! 
pdfOverlay.summlid = '0EH90000000Gdtu'; 

 pdfOverlay.setSavable(true); 

 //change this to use the quote id 
pdfOverlay.setContents('/quote/quoteTemplateDataViewer.apexp?id={!Quote.Id}','quote/quoteTemplateHeaderData.apexp?id={!Quote.Id}'); 

 pdfOverlay.display();

Kindly suggest some soln.