• ArchieCom
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

 

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!

 

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!