Configure the finishLocation Attribute in a Flow
The following sections show the ways that you can configure the <flow:interview> component’s finishLocation attribute.
Set finishLocation with the URLFOR Function
To route users to a relative URL or a specific record or detail page, using its ID, use the URLFOR function.
1<apex:page>
2 <flow:interview name="MyUniqueFlow" finishLocation="{!URLFOR('/home/home.jsp')}"/>
3</apex:page>1<apex:page>
2 <flow:interview name="MyUniqueFlow" finishLocation="{!URLFOR('/001D000000IpE9X')}"/>
3</apex:page>For more information about URLFOR, see Functions.
Set finishLocation with the $Page Variable
1<apex:page>
2 <flow:interview name="MyUniqueFlow" finishLocation="{!$Page.MyUniquePage}"/>
3</apex:page>For more information about $Page, see Global Variables.
Set finishLocation with a Controller
You can set finishLocation in a few ways with a custom controller.
This sample controller configures a flow's finish behavior in three different ways.
1public class myFlowController {
2
3 public PageReference getPageA() {
4 return new PageReference('/300');
5 }
6
7 public String getPageB() {
8 return '/300';
9 }
10
11 public String getPageC() {
12 return '/apex/my_finish_page';
13 }
14}Here’s a sample Visualforce page that references the controller and sets the flow finish behavior to the first option.
1<apex:page controller="myFlowController">
2 <h1>Congratulations!</h1> This is your new page.
3 <flow:interview name="flowname" finishLocation="{!pageA}"/>
4</apex:page>If you use a standard controller to display a record on the same page as the flow, users who click Finish start a new flow interview. They see the first screen of the flow, without the record, because the id query string parameter isn't preserved in the page URL. If needed, configure the finishLocation to route users back to the record.