You need to sign in to do that
Don't have an account?
John Smith 266
Apex help needed for flow finish location
I am trying to set the Finish Location for my flow to either go to the detail page of the Opp created by the flow or reload the flow. My VF page and Apex controller are below. I'm getting an error: "Invalid Page Redirection. The page you attempted to access has been blocked due to a redirection to an outside website or an improperly coded link or button."
When I hard code the PageReference to ('/' + anExistingOppID), then it redirects to that record just fine. So I know the issue is with my getFinishURL() method. The flow variable that is supposed to be pulled is either the newly created record ID or the URL for the visualforce tab that houses the flow. I added a troubleshooting screen to the flow to see the variable value assignment and it looks correct to me.
Any ideas what I might be missing?
Controller:
public class MemberPaymentFinishController {
public Flow.Interview.Manual_Membership_Payment theFlow {get; set;}
public String getFinishURL() {
String FinishURL;
if (theFlow==null) return '';
else FinishURL = (string) theFlow.getVariableValue('varFinishID');
return(FinishURL);
}
public PageReference getFinishPage(){
PageReference p = new PageReference('/' + getFinishURL() );
return p;
}
}
VF page
<apex:page Controller="MemberPaymentFinishController" > <br/> <flow:interview name="Manual_Membership_Payment" finishlocation="{!FinishPage}" /> </apex:page>
When I hard code the PageReference to ('/' + anExistingOppID), then it redirects to that record just fine. So I know the issue is with my getFinishURL() method. The flow variable that is supposed to be pulled is either the newly created record ID or the URL for the visualforce tab that houses the flow. I added a troubleshooting screen to the flow to see the variable value assignment and it looks correct to me.
Any ideas what I might be missing?
Controller:
public class MemberPaymentFinishController {
public Flow.Interview.Manual_Membership_Payment theFlow {get; set;}
public String getFinishURL() {
String FinishURL;
if (theFlow==null) return '';
else FinishURL = (string) theFlow.getVariableValue('varFinishID');
return(FinishURL);
}
public PageReference getFinishPage(){
PageReference p = new PageReference('/' + getFinishURL() );
return p;
}
}
VF page
<apex:page Controller="MemberPaymentFinishController" > <br/> <flow:interview name="Manual_Membership_Payment" finishlocation="{!FinishPage}" /> </apex:page>
Dixit
if you debbug the "FinishURL" string, is it bringing the correct value?