You need to sign in to do that
Don't have an account?
Heather_Hanson
SavePDF, pageReference multiple VF pages?
I would like my SavePDF action to save the French and English PDF visualforce pages I have. I've tried using an if/else statment but couldn't get it to work so I thought I would just try to have BOTH attached no matter what, but I'm having trouble getting that to work too...
Is this possible? Here is what I've tried based on my research:
Is this possible? Here is what I've tried based on my research:
public pageReference savePDF(){ PageReference pagePdf = new PageReference('/apex/Residential_Order_Form_PDF'); new PageReference('/apex/Residential_Order_Form_PDF_French'); pagePdf.getParameters().put('id', idVal); Blob pdfPageBlob; pdfPageBlob = pagePdf.getContentAsPDF();Should I be stating it differently?
All Answers
Now that resulted in 2 attachments as I hoped, but they were both in English (so they were both "/apex/Residential_Order_Form_PDF").
This is where I get a bit confused because my custom button is programmed to call the French forms if the opportunity language is French, which it is when I'm testing it. So I press the button, see the French HTML form, press the PRINT button and see the French PDF form, but I press SAVE PDF and it saves the English. I don't mention language in the Apex Class, I had hoped I could just reference the forms I want, but do I have no choice here? I don't have the language field referenced on my page and didn't want to figure out how to squeeze that in. Any further suggetions?
Thank you!!