+ Start a Discussion
Jason SchroederJason Schroeder 

Apex flow to return to contract page?

We set up a flow to generate a contract. the Detail button is currently set on the account. the sales team runs through the generator and clicks finish and it starts back over. I would rather have it take me to the contract that it just created, so I found that you can build a apex page that will take you to the url. Can I get it to take me to the exact contract I just created?

here is what I found to put into a apex page. 
<flow:interview name="Contract_Generator" finishLocation="{!URLFOR('/

But I am not sure what to finish the statement with.
ShashankShashank (Salesforce Developers) 
It is possible. Please see this on how to set the finishlocation: http://www.salesforce.com/docs/developer/pages/Content/pages_flows_finishlocation.htm

One way is to get the id of the record using the parameters of the page reference and using a controller to set it as a finishlocation.

You can also have a look at this: https://developer.salesforce.com/forums/ForumsMain?id=906F00000009AgOIAU