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
Janno RipJanno Rip 

Creating a PDF for a Quote in Lightning Flow

Hello everyone,

I want to automate the whole process of Opportunity creation so I created a Flow that creates an Opportuntiy with OppLineItems and a Quote with QuoteLineItems. The last step would be to create the PDF for that very quote.

While I am able to "Create Record" with the object "Quote PDF" the pdf itself is blank:

User-added imageUser-added imageI did not chose a "TemplateId" and thought that was the reason. However I find NO way to access the ID of my quote template. I am not even sure this is a real thing because using tools like workbench are not even displaying that field. Seems like this is some CPQ only stuff.

So is this possible using Flow? Creating a complete PDF for a Quote?

Thanks!
ANUTEJANUTEJ (Salesforce Developers) 
Hi Janno,

I found the link [ https://salesforce.stackexchange.com/questions/16481/how-can-i-add-a-pdf-document-to-my-flows ] which states a way to call apex class from a flow, but to my knowledge I don't think it would be possible to create a pdf from a flow instead as mentioned you can indeed call a apex class which can inturn create a pdf.

Can you also look at the below links for reference:

>>https://medium.com/@ToAnshulVerma/salesforce-lightning-generate-pdf-from-lightning-components-with-in-memory-data-cd5dffe0fe25

I hope this helps and in case if this came in handy can you please choose this as the best answer so that it can be used by others in the future.

Regards,
Anutej
Octavio KuhlOctavio Kuhl

Hi, i found that the QuoteTemplate Id can be found in the URL in CLASSIC mode, no lightning... hilarious.

Nevretheless I try this with a Quote Id and the template Id and an error appeared.... I dont know if the "Document" field has to be populated somehow.

I manage to make an screenflow that allows me to select bewteen some templates and execute an apex code to create the Pdf. I need it so I could add it as a custom button for Mobile where there is no createPdf button available.

I´m gonna post this solution in linkedin for sure and maybe get in touch with SFBEN but if you need it let me know.