I just created a flow that looks up an account and displays a screen to allow the user to enter values in a textbox and select something from a dropdown. It then creates an opportunity using some account information and data entered on the screen and creates an opportunity contact role. The flow is fired by clicking on a custom button on the account.

The flow will run and open the screen to allow me to enter values. I click next and the flow creates the opportunity and the opportunity contact role. Then the same screen is displayed again, essentially either creating another opportunity/contact role or requiring me to exit out of the flow.

This is very annoying. In attempting to debug the problem, I opened up the developer console to look at the logs. I see when I click the button to start the flow, a log file with the operation of /flow/create_partner_opportunity is created. This is expected as that is the name of my flow, but after I fill out the screen element and click next (a.k.a. when the opportunity and contact role are created), two more logs are created with the same operation of /flow/interview.apexp.

I need this behavior to stop. I do not know if the interview.apexp is what is causing this issue, but figured it was a likely culprit.

Google wasn't much help in revealing others with this problem.

Thanks in advance.

1 Answer 1


This is because nothing has been defined on what the Flow should do when it is done, so it will always go back to the beginning of the Flow. It's not very well documented, but it is established behavior.

In the URL of your custom button, try adding this to the end of the URL: ?retURL=/[merge field of your choice]

For example, if you Flow URL is /flow/create_partner_opportunity, the URL would be something like: /flow/create_partner_opportunity?varOppID={!Opportunity.Id}&retURL=/{!Opportunity.Id}

This would return you to the Opp from which you clicked the button.

The retURL argument tells the URL which page the flow should return you to when it has finished.

  • Exactly what I needed. The flow only fires once now. Thanks!
    – Optimus
    Commented Feb 27, 2015 at 19:47

You must log in to answer this question.

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