Hi,
I have a custom JS button in Salesforce Classic that is used for Quote functionality. The button mimics the standard CreatePDF button but automatically defines the Quote Template by referencing a formula field on the Quote record.
I am trying to recreate this functionality in Lightning without resorting to creating a lightning component. Can anybody suggest any options?
Original Classic JS Button Code:
{!RequireScript("/soap/ajax/38.0/connection.js")}
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=\"Cancel\" class=\"btn\" name=\"cancel\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').close();\" title=\"Cancel\" type=\"button\" />';
pdfOverlay.summlid = '{!Quote.Quote_Template_ID__c}';
pdfOverlay.setSavable(true);
pdfOverlay.setContents('/quote/quoteTemplateDataViewer.apexp?id={!Quote.Id}','/quote/quoteTemplateHeaderData.apexp?id={!Quote.Id}');
pdfOverlay.display();
Hi Nagarjuna,
I'm well aware that Javascript buttons are not supported in Lightning, this is why I am seeking to recreate the functionality. My question specifically relates to the standard 'CreatePDF' function on the Quote object. In Salesforce Classic, creating a custom JS button to pre-define the Quote Template so that the user is not required to choose the template is simple (as per my original button).
None of the links you have provided address this in any way. Do you have any advice specific to the challenge if creating a customer 'CreatePDF' button on the Quote object in Salesforce Lightning?
Thanks!
Todd