How to configure the finishlocation attribute in a flow?

How to configure the finishlocation attribute in a flow?

You can shape what happens when a user clicks Finish on the final screen by using the URLFOR function, the $Page variable, or a controller. The following sections show the ways that you can configure the component’s finishLocation attribute. You can’t redirect flow users to a URL that’s external to your Salesforce org.

Why do I see the record on the first page of the flow?

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.

How to set the flow finish behavior to a newly created record?

Our Visualforce Page is doing an Action of calling our FlowRedirectController on the opening of the page. Resulting in an immediate redirect to the newly created record. Let’s watch it in action! And just like that we have bypassed the “must have a screen” feature in Flow for a redirect.

When does finishlocation execute in a Visualforce flow?

Auth.SessionManagement.finishLoginFlow indicates the end of a Visualforce page login flow. If finishLocation is in the same flow, finishLocation executes when the flow starts, giving users full access to the session.

How to set finishlocation in a custom 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. getPageA instantiates a new page reference by passing a string to define the location. getPageB returns a string that is treated like a PageReference.

Is there a way to dynamically redirect a flow?

There is another way to be able to redirect a Flow dynamically based on variables in the Flow. Instead of wrapping a Flow in a Lightning Component, you can instead add the Lightning Component as part of the Flow, either through a Flow Screen or through a Flow Action.