You need to sign in to do that
Don't have an account?
deux4ever
Attempt to de-reference a null object (Visualforce and Flow)
When I try to run my Visualforce page, I get the error "Attempt to de-reference a null object" as soon as I preview it. Not sure what is going on or where to look for the error, but below is my VF code and controller.
Visualforce Page
Controller
Visualforce Page
<apex:page controller="mySignatureController"> <apex:pageBlock> <flow:interview name="Signature_Flow_Page" interview="{!mySignatureFlow}" finishLocation="{!finishURL}"/> </apex:pageBlock> <apex:pageBlock> <apex:detail subject="{!AccountID}" relatedList="false" /> </apex:pageBlock> </apex:page>
Controller
public class mySignatureController{ public Flow.Interview.Signature_Flow_Page mySignatureFlow { get; set;} public String getAccountID() { if (mySignatureFlow==null) return ''; else return mySignatureFlow.AccountID; } public PageReference getfinishURL() { PageReference p = new PageReference('/' + mySignatureFlow.AccountID); p.setRedirect(true); return p; } }
My guess is that it is going to be line# 09. mySignatureFlow might be null and you are trying to acess an attribute of it. Replace it with this
Visit forcetree.com for code samples and tips.