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:
/flow/Close_Opportunity_w_Handoff?OpportunityID={!Opportunity.Id}&UserTitle={!$User.Title}
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}"/>
</apex:page>
Controller:
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();
p.setRedirect(true);
return p;
}
}