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
Lourdes MonteroLourdes Montero 

Finish location not working in flow

So I have a flow so that users can create cases.

In my current flow Screen Input -> record create -> Thank you screen.
I want users to go back from the thank you screen and edit what they wrote without creating duplicate records, So I changed the order of operations.
It would be Screen Input -> thank you -> record create. The problem with this is that my Finish_location is not working.
I get the following error:  
User-added image



The Visualforce page code:
<apex:page controller="Quick_Case" >
    <flow:interview name="Quick_Case" interview="{!flowInstance}" finishLocation="{!FinishLocation}" buttonLocation="bottom">
        <apex:param name="Role" value="{!$User.UserRoleId}"/>
        <apex:param name="Department" value="{!$User.Department}"/>
        <apex:param name="CurrUserID" value="{!$User.Id}"/>
    </flow:interview>
</apex:page>






The Apex Class:

 
public class Quick_Case {

    Public Flow.Interview.Quick_Case flowInstance{get; set;}
    
    Public PageReference getFinishLocation(){
        
        String ID = '';
        if(flowInstance != null)
              ID = flowInstance.caseid;
        
        PageReference send = new PageReference('/' + ID);
        send.setRedirect(true);
        return send;
        
    }
    
}

 
James LoghryJames Loghry
I just recreated this flow and visualforce page in my dev org, and was able to get it working.  When you created the caseId variable (assuming this is the Id result from the Record Create element?) did you mark it as "Output only" for the Input/Output type? 

Otherwise, your VF and controller page look good.