2

I am trying to generate QuotePDF on click of a JS button. I have not created any VF Page for the PDF and am trying to use the standard functionality. My code to generate PDF is:-

PageReference pr = new PageReference('/quote/quoteTemplateDataViewer.apexp?id='+q.id+'&'+'summlid='+TemplateId); 
    System.debug('Page reference > ' + pr);  
    Blob pdfBlob = pr.getContent(); 
    sr.add (new QuoteDocument( 
    QuoteId = q.Id, 
    document = pdfBlob));  
    System.debug('Quote Id Document > ' + q.Id); 
 } 
 insert sr; 

I am getting following error on the line Blob pdfBlob = pr.getContent();:-

15:29:04:253 FATAL_ERROR System.VisualforceException: ORA-20001: ORA-06512: at "SLEEPY.CACCESS", line 1863ORA-06512: at "SLEEPY.CACCESS", line 3005ORA-06512: at "SLEEPY.CACCESS", line 2874ORA-06512: at line 1SQLException while executing plsql statement: {call cAccess.check_entity_access_ncu(?,?,?,?,?,?)}(EXCLUDED, EXCLUDED, 0Q0N000000098ge, EXCLUDED, true, false)

Kindly help.

crmprogdev
  • 40,955
  • 9
  • 58
  • 115
Vandana
  • 153
  • 1
  • 3
  • 13
  • Your button can't possibly work without a visualforce page to render as a PDF. If you're rendering the page the button is on, then you could be creating the blob from it and opening it in a new window without any problem. But unless you have a reference page to render, your button will always fail. If you can clarify how you're testing it, you might get a better response. You may also want to look at How do I start to debug my own VF javascript. – crmprogdev Jul 20 '14 at 14:46
  • 3
    @crmprogdev It's a dwarven error (lots of them this release?), so they should contact support. They're trying to do something that appears should work, but doesn't. Your solution won't help, because it's not their code that is failing. It's an internal server error. – sfdcfox Jul 20 '14 at 15:22
  • Thanks for popping in with the scoop on this being related to the new release. Am between assignments at the moment and not working in a production org to have seen this myself. – crmprogdev Jul 20 '14 at 16:50
  • Thanks for all your replies. So it appears best would be to create a VisualForce page for the Quote PDF. Can anyone gimme any pointers to any such pages already created. A sample code would be really helpful. – Vandana Jul 21 '14 at 00:19

0 Answers0