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
vishwjeet singhvishwjeet singh 

Salesforce Error pdf generating.

Hello,

Internal Salesforce.com error.

We are facing issue while generating pdf, below is the sample code we are using and the last line is causing issue. The code get stuck on line 4 "pdfInstant = samplevfpdf.getContentAsPDF()" and process does not proceed after this line.

// Sample code
Line 1: Blob pdfInstant;

Line 2: pagereference samplevfpdf = new pagereference('https://xxxxx--dotsuat1.my.salesforce.com/InvoiceSendPdf?Id=a1E0r0000032SGPEA2');

Line 3:samplevfpdf.setRedirect(true);

Line 4: pdfInstant = samplevfpdf.getContentAsPDF(); // This the line where code get stuck

I have tried to run this sample code on anonymous window and when line 4 execute we got the screen(please see attached "AnonymousScreenShot" ) . We are using this sample code in our pdf generation process on production and facing Internal Salesforce.com error(Please see attached "ErrorLogWhenProcessRun").

Please look into this asap as it affecting the business.

User-added image