Skip to content

Instantly share code, notes, and snippets.

@Opopanax
Forked from noeticpenguin/ExampleVFFlowPage.html
Created April 18, 2014 16:06
Show Gist options
  • Select an option

  • Save Opopanax/11051749 to your computer and use it in GitHub Desktop.

Select an option

Save Opopanax/11051749 to your computer and use it in GitHub Desktop.
<apex:page Controller="FlowRedirectController">
<flow:interview name="FLOW_NAME_HERE" interview="{!FlowName}" finishLocation="{!redirectTo}" >
<!--
Any Params you need to pass into your flow.
<apex:param name="CaseId" value="{!CaseId}"/>
-->
</flow:interview>
</apex:page>
public with sharing class FlowRedirectController {
public Flow.Interview.RedirectId redirectId{get;set;}
public PageReference redirectTo(){
if(redirectId != null) {
returnId = redirectId.vRedirectId;
}
PageReference send = new PageReference('/' + returnId);
send.setRedirect(true);
return send;
}
}
@Opopanax
Copy link
Author

<apex:page Controller="FlowRedirectController">
<flow:interview name="FLOW_NAME_HERE" interview="{!FlowName}" finishLocation="{!redirectTo}" >

/flow:interview
/apex:page

public class FlowRedirectController{
public Flow.Interview.FLOW_NAME_HERE redirectId {get;set;}

public PageReference redirectTo(){
    string returnId;
    if(redirectId != null) {
        returnId = (string)redirectId.getVariableValue('vRedirectId');
    } 
    PageReference send = new PageReference('/' + returnId);
    send.setRedirect(true);
    return send;
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment