You need to sign in to do that
Don't have an account?
Raghavendra M 13
How to save PDF attachment using Lightning Component?
When clicking on a lightning button displaying a visual force pdf page , how can i insert that pdf attachment in notes and attachments
please refer
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_lightning_fileUpload.htm
If this solves your problem, mark it as solved.
When clicking on a lightning button displaying a visual force pdf page , how can i insert that pdf attachment in notes and attachments
You can use 2 VF pages for that.One page contains button to save PDF as attachments and contains 2nd page(rendered as PDF) in iFrame.
When clicking on save button run a controller method to save the PDF as attachment.
Use something like this your method.
currentid = Apexpages.currentPage().getParameters().get('Id');
PageReference pageRef = new PageReference('/apex/newinvoice?id='+currentid);
pageRef.setRedirect(true);
Blob pdfBlob = pageRef.getContentAsPDF();
Attachment att = new Attachment();
att.Name = 'Pradeep'+'_'+ string.valueOf(System.today())+'.pdf';
att.ParentId = currentid;
att.Body = pdfBlob;