You need to sign in to do that
Don't have an account?
Spring '09 Apex/VF/PDF issues
Had a VF page and controller that was working fine until Spring '09 was installed. It appears that any values in any public variables are maintained fine when rendered as HTML output and we get a single debug log. However, if we renderAs="pdf", we end up with multiple log entries and the controller values are lost between the two separate logs resulting in a bunch of null value errors. What's changed in Spring '09 and how do we accomodate for this? An simple pseudo-code example would be:
public Account myAcct; public Account getAccount() { myAcct = ([SELECT name FROM Account where somecriteria]) System.debug('myAcct Name='+myAcct.name); } public getAcctName() { System.debug('myAcct Name='+myAcct.name); return myAcct.name;}
This is a simple example but the first debug statement works fine. The second one returns a null error/value when rendering as PDF. However, rendering as HTML doesn't have a problem.
Issue solved thanks to Doug Chasman and this post:
http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=9805
It's an issue with the Action function that is not guaranteed to run. So we changed to a constructor instead and all is well. This should be documented somewhere in the VisualForce documentation not to use that function.
All Answers
Is your controller perhaps based on StandardSetController? Check out this thread which may shed some light. However, the problem you describe, which is similar to what is described in the thread, was present in Winter and apparently fixed in Spring 09 (I haven't seen the fix in action yet). Can you post your full controller and page code?
Jeremy Kraybill
Austin, TX
In this thread, Doug Chasman says there is a known issue which they are working on a fix for right now, that seems more likely to be the cause of your issue. I'd suggest opening a support case to track the fix.
Jeremy Kraybill
Austin, TX
Issue solved thanks to Doug Chasman and this post:
http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=9805
It's an issue with the Action function that is not guaranteed to run. So we changed to a constructor instead and all is well. This should be documented somewhere in the VisualForce documentation not to use that function.