My organization has a custom button on the Opportunity which calls a Flow to create the Opportunity. The code for the button is as follows:


We are now getting ready to implement Opportunity Products and we would like to have the end point for the flow above to be the add products page from the newly created Opportunity. Can anyone tell me how to accomplish this? I am very new to flows and this is one that was created by someone before me. Thanks for any help!

VF Page:

<apex:page standardController="Opportunity" tabStyle="Opportunity">
    <flow:interview name="Create_Opportunity_w_Parent_Fixed" finishLocation="/p/opp/SelectSearch?addTo={!opportunity.Id}&retURL=%2F{!opportunity.Id}"/>


public class OpptyFlowController {

  public Flow.Interview.Create_Opportunity_w_Parent_Fixed OppFlow { get; set; }

    public String getOppID() {
      if (OppFlow==null) return '';
      else return OppFlow.OpptyID;

  public PageReference getOID(){
    PageReference p = new PageReference('/p/opp/SelectSearch?addTo=' + getOppID() + '&retURL=%2F' + getOppID();
  return p;


2 Answers 2


In this situation I normally have the flow embedded in a VisualForce page, which may sound a bit intimidating if you haven't used one before but it's literally just a few lines.

Basically you create a very simple page like the below. This would send the user to another VF page:

    <flow:interview name="MyUniqueFlow" finishLocation="{!$Page.MyUniquePage}"/>

This to a particular non VF page:

    <flow:interview name="MyUniqueFlow" finishLocation="{!URLFOR('/home/home.jsp')}"/>

You will need to set the standard controller of the VF page available so that the button is available.

Some helpful links: https://help.salesforce.com/HTViewHelpDoc?id=vpm_admin_onfinish.htm&language=en_US http://www.salesforce.com/docs/developer/pages/Content/pages_flows_finishlocation.htm

  • Thanks. I created a VF page and a controller, but the page won't show up in my custom list button as an option. Any idea why?
    – John N.
    Commented Mar 17, 2015 at 21:02
  • How is the button currently set up, can you share a screen shot of it?
    – Girbot
    Commented Mar 17, 2015 at 21:49
  • I'm not sure how to share a screenshot. The button is a List Button, Display in Existing Window with Sidebar, URL content source, and the URL is: /flow/Create_Opportunity_w_Parent_Fixed?AccountID={!Account.Id}&UserTitle={!$User.Title}
    – John N.
    Commented Mar 18, 2015 at 3:03
  • FYI, I figured out my issue. I had to change my VF page statement to: <apex:page standardController="Opportunity" tabStyle="Opportunity" Extensions="OpptyFlowController" recordSetVar="opportunities">
    – John N.
    Commented Mar 19, 2015 at 16:20

See the following post: Help with finishLocation on flow which details how to set the ending location for the flow controller. All you'd need to do is pass that URL to your controller.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .