You need to sign in to do that
Don't have an account?

Redirect Page not working correctly without the end screen
Hello,
I have a visual workflow, where I post some questions (Yes or No type in a radio button). Now depending on the answers to the questions, the decision path redirects to different path where we assign a variable to be true or false. So the visual workflow just has a screen, a decision and assignment elements for both the paths. I do not have an end screen element. Now, I am redirecting to different pages based on the value and this is not working if I do not have the end screen (if works if I have the extra end screen). I do not want a unnecessary end screen for my flow. How can I achieve this?
My VF page code is:
:
<apex:page sidebar="false" controller="PGIPathDeciderController" >
<flow:interview name="TestPath" interview="{!aFlow}" finishLocation="{!FinishPage}">
<apex:param name="FlowQuoteID" value="{!quoteId}"/>
</flow:interview>
</apex:page>
My controller code is:
public class PGIPathDeciderController
{
public Quote theQuote {get; set;}
public Flow.Interview.TestPath aFlow {get; set;}
public String quoteId {get; set;}
public PGIPathDeciderController ()
{
Id id = ApexPages.currentPage().getParameters().get('Id');
if(id != null)
{
quoteId = id;
theQuote = [SELECT Name, BillingName, BillingStreet, BillingCity, BillingState, BillingCountry,
BillingPostalCode, Phone, Status, Id,
Opportunity.Account.Id, Account__c, OpportunityId, isConfigureCompany__c
FROM Quote WHERE Id = :quoteId LIMIT 1];
}
}
public boolean getRedirectFlag()
{
if (aFlow == null)
{
return false;
}
else
{
return aFlow.redirectPath;
}
}
public PageReference getFinishPage()
{
system.debug('aFlow' + aFlow);
PageReference prEdit;
if (getRedirectFlag())
{
prEdit = Page.PGICompaniesAndContacts;
prEdit.getParameters().put('id', theQuote.ID);
prEdit.setRedirect(true);
}
else
{
prEdit = new ApexPages.StandardController(theQuote).view();
prEdit .setRedirect(true);
}
return prEdit ;
}
}
Thanks!
You can't. There's a number of posts here outlining that "bug". I put a couple below.
http://boards.developerforce.com/t5/Visual-Workflow/Flow-variables-not-passing-back-to-VF-Controller-Extension/m-p/504513#M803
http://boards.developerforce.com/t5/Visual-Workflow/Flow-amp-VisualForce-error-Attempt-to-de-reference-a-null-object/m-p/653071#M1480
Darrell
All Answers
You can't. There's a number of posts here outlining that "bug". I put a couple below.
http://boards.developerforce.com/t5/Visual-Workflow/Flow-variables-not-passing-back-to-VF-Controller-Extension/m-p/504513#M803
http://boards.developerforce.com/t5/Visual-Workflow/Flow-amp-VisualForce-error-Attempt-to-de-reference-a-null-object/m-p/653071#M1480
Darrell
Thanks for the update.