Hi,
I am currently facing an issue in our production environment related to the generation of a Proforma Invoice and saving the corresponding PDF to the 'Notes and Attachments' section.
In our Order object, when the stage is set to 'Invoice,' we trigger the generation of a Proforma Invoice by clicking the 'Generate Invoice' button. The PDF rendering is handled through an Aura component named 'generateOrderContract,' which embeds a Visualforce page called 'ProformaInvoiceNew.'
While this functionality works seamlessly in our sandbox environment, post-deployment to production, an error occurs when attempting to save the rendered PDF to attachments. The error displayed on the UI is as follows: "Error: An internal server error has occurred. Error ID: 189341393."
The code is:
PageReference pdfPage = new PageReference(pageurl);
Blob pdfData;
if (!Test.isRunningTest()) {pdfData = pdfPage.getContentAsPDF();}
else {
pdfData = Blob.valueOf('This is a test.');
}
In this getContentAsPDF(); is not working(not getting any value).
Please help me with some solution.