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
John Smith 266John Smith 266 

problems with PageReference or instantiating flow

I'm trying to set the finish location of a flow to the record created in that flow. I've tried setting up the controller a million different ways, but I keep getting an invalid page redirection error when the flow is finished.
 
It seems like, for some reason, my flow is not being instantiated as "theFlow". If I set the page reference to ('/' + 'home/home.jsp') or to a specific opp ID, then the finish location works fine. But any flow variable or anything referenced by theFlow.XXX fails.
 
Debug logs seem to indicate that theFlow is always null. And, if I include interview="{!theFlow}" in the visualforce page, it fails with an internal server error. All flow variables are set to input/output and there is a confirmation screen after the record create.
 
I have no idea what I might be missing. If the apex looks fine, what other user/org/security settings should I double check?
 
Here is the visualforce page code. It's being called by a custom tab if that matters. Also, all this is being done in my recently refreshed sandbox.
 
<apex:page Controller="MemberPaymentFinishController2" >
<flow:interview name="Manual_Membership_Payment" finishlocation="{!FinishPage}" />
</apex:page>

Controller: 

public class MemberPaymentFinishController2 {
    public Flow.Interview.Manual_Membership_Payment theFlow {get; set;}
    public String getFinishURL() {
        String FinishURL;
        if (theFlow==null) return '';
        else return theFlow.varOppID; }
   public PageReference getFinishPage(){
      PageReference p = new PageReference('/' + getFinishURL());
      return p; }
}