0

I have a custom VFP button that runs a parent flow, that runs a sub flow. The finishLocation of the flow is a page redirect to a custom object. I can't seem to pull over the value of the varCreditReviewId. I am now getting no errors but the value of the varCreditReviewId is still null. How do I carry this value over to a non-static context?

Button:

<apex:page standardController="Opportunity" tabStyle="Opportunity" extensions="FlowToWebservice_Redirect" >
<flow:interview name="Parent_Flow" finishLocation="/{!CRID}" > //I have also tried: finishLocation="'/' + '{!CRID}'">
    <apex:param name="inputOpptyID" value="{!Opportunity.Id}"/>
</flow:interview>
</apex:page>

This is my Redirect Class:

public class FlowToWebservice_Redirect {
public string creditReviewId;

public FlowToWebservice_Redirect(ApexPages.StandardController controller){} 

public String getmyID() {  
    FlowToWebservice_Class ftwsc = new FlowToWebservice_Class();
    creditReviewId = ftwsc.varCreditReviewId;
    if (creditReviewId == null) {
        return null;
    }
    else {
        return creditReviewId;
    }
}

public PageReference getCRID(){
    PageReference p = new PageReference('/' + getmyID());
    p.setRedirect(true);
    return p;
}

This is my Process Plugin Class:

global class SubFlowToWebservice_Class implements Process.Plugin {
    global static String varCreditReviewId {get;set;}

    global Process.PluginResult invoke(Process.PluginRequest request) {
        varCreditReviewId = (String)request.inputParameters.get('varCreditReviewId');
   ....
}

1 Answer 1

0

I ended up taking my extension class and calling the flow variables rather then the APEX Class variables. As you can see flow2 is an instance of Parent_Flow and this flow has a input/output variable "varCreditReviewID". I was able to redirect to this variable value and it worked!

public class FlowToWebservice_Redirect {
    public Flow.Interview.Related_Deal_Search aFlow {get; set;}
    public Flow.Interview.Parent_Flow aFlow2 {get; set;}

    public FlowToWebservice_Redirect(ApexPages.StandardController controller){} 

    public String getCRID() {
        if (aFlow2==null) return '';
        else return aFlow2.varCreditReviewID;
    }

    public PageReference getFinishPage(){
        PageReference p = new PageReference('/' + getCRID() );
        p.setRedirect(true);
        return p;
    }
}

You must log in to answer this question.

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