You need to sign in to do that
Don't have an account?
liron169
Internal SF error when in function getContentasPDF
Hi,
I have report - PDF page - that run sometimes on large amount of data.
with too much data, it failed when loading the page to the screen, so I try different approach- generating the page in background, and attach it to the chatter.
It does incrase the capacity of the report, but still in some amount of data it fails, and I can see in log Internal Salesforce.com Error.
I'm not hitting any other SF limitation (CPU close to limit, but not beyond).
The PDF (that failed) expected to be ~1.5MB, with ~800-1000 pages.
I able to generate it with ~1MB, ~600 pages.
Anyone have idea possible reason for this error?
global class AddPdfToRecord{
webservice static void addPDF(){
PageReference pdf = Page.TestLiron;
pdf.getParameters().put('parm1','111');
pdf.getParameters().put('parm2','222');
pdf.setRedirect(true);
//system.debug('URL: ' + pdf.getURL());
Attachment attach = new Attachment();
Blob body;
try
{
body = pdf.getContentasPDF(); //here the failure
// post to chatter
FeedItem post = new FeedItem();
post.ParentId = '0F9c00000008efE'; // nickforce chatter group id
post.Body = 'Report for..';
post.Type = 'ContentPost';
post.ContentData = body;
post.ContentFileName = 'FMR_TEST' + '.pdf';
insert post;
}
catch(Exception e)
{system.debug('EEEEEEEEEEEEEEEE' + e) ;}
}
}
I have report - PDF page - that run sometimes on large amount of data.
with too much data, it failed when loading the page to the screen, so I try different approach- generating the page in background, and attach it to the chatter.
It does incrase the capacity of the report, but still in some amount of data it fails, and I can see in log Internal Salesforce.com Error.
I'm not hitting any other SF limitation (CPU close to limit, but not beyond).
The PDF (that failed) expected to be ~1.5MB, with ~800-1000 pages.
I able to generate it with ~1MB, ~600 pages.
Anyone have idea possible reason for this error?
global class AddPdfToRecord{
webservice static void addPDF(){
PageReference pdf = Page.TestLiron;
pdf.getParameters().put('parm1','111');
pdf.getParameters().put('parm2','222');
pdf.setRedirect(true);
//system.debug('URL: ' + pdf.getURL());
Attachment attach = new Attachment();
Blob body;
try
{
body = pdf.getContentasPDF(); //here the failure
// post to chatter
FeedItem post = new FeedItem();
post.ParentId = '0F9c00000008efE'; // nickforce chatter group id
post.Body = 'Report for..';
post.Type = 'ContentPost';
post.ContentData = body;
post.ContentFileName = 'FMR_TEST' + '.pdf';
insert post;
}
catch(Exception e)
{system.debug('EEEEEEEEEEEEEEEE' + e) ;}
}
}
No number is given.
Only error indication
We don't see error number as it is not a bug in SF, and we don't see exception error is this exception cannot be cauot.
In case anyone facing this issue, Check the access for VF page that you coverting to PDF. I was getting same error tried all way but finally was able to make it work after Enale the Access for VF page for Profile.
Profile - VisualForce Page (EDIT) > Add VF page - It will solve this issue.