0

The screen flow in my VF page renders only after a couple of apex:selectList values are chosen:

'Report an Issue' --> 'One or More App Servers' --> Flow

enter image description here

I want the flow's finish location to be the same page with the same picklist values selected. However, all of my attempts take me back to the very start of the page with no values selected:

enter image description here

Next I'll give unchanging, relevant portions of my code, followed by my finish-location-code attempts and their URL results.

Portions of my VF markup:

<apex:page standardController="Account" extensions="ItemEditController">
    <apex:sectionHeader title="Issue Reporting Manager"/>

    <apex:form >
        <apex:pageBlock id="reportOrClear">
            <apex:pageBlockSection title="Task:" collapsible="false">
                <apex:pageBlockSectionItem >
                    <apex:selectList value="{!tasks}" multiselect="false" size="1">
                        <apex:selectOptions value="{!items1}"/>
                        <apex:actionSupport event="onchange" action="{!onChangeFnCall1}"/>
                    </apex:selectList><p/>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
        </apex:pageBlock>            
    </apex:form>        

    <apex:form >
        <apex:pageBlock id="reportAppORCustomer" rendered="{!reportAppORCustomerRendered}">
            <apex:pageBlockSection title="The issue pertains to:" collapsible="false">
                <apex:pageBlockSectionItem >
                    <apex:selectList value="{!issueHavers}" multiselect="false" size="1">
                        <apex:selectOptions value="{!items2}"/>
                        <apex:actionSupport event="onchange" action="{!onChangeFnCall2}"/>
                    </apex:selectList><p/>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
        </apex:pageBlock>            
    </apex:form>        

    <apex:pageBlock id="reportApp" title="App Servers" mode="edit" rendered="{!reportAppRendered}">
        <flow:interview name="Report_Issue" buttonLocation="bottom" finishLocation="{!CurrentPage}"/>
    </apex:pageBlock>

</apex:page>

Portions of my Controller Extension:

public with sharing class ItemEditController {

  private ApexPages.StandardController controller {get; set;}
  public String  tasks{get;set;}
  public String  issueHavers{get;set;}
  public boolean reportAppORCustomerRendered{get;set;}
  public boolean reportAppRendered{get;set;}
  public boolean reportCustomerRendered{get;set;}

  // standard controller - could also just use custom controller
  public ItemEditController(ApexPages.StandardController controller) { }

  public List<SelectOption> getItems1() {
      List<SelectOption> options = new List<SelectOption>();
      options.add(new SelectOption('','--None--'));
      options.add(new SelectOption('reportIssue','Report an Issue'));
      options.add(new SelectOption('clearIssue','Clear an Issue'));
      return options;
  }

  public List<SelectOption> getItems2() {
      List<SelectOption> options = new List<SelectOption>();
      options.add(new SelectOption('','--None--'));
      options.add(new SelectOption('appServers','One or More App Servers'));
      options.add(new SelectOption('specAccounts','A Specific Customer'));
      return options;
  }

  public String getTasks() {
      return tasks;
  }

  public String getIssueHavers() {
      return issueHavers;
  }

  public void setTasks(String tasks) {
      this.tasks = tasks;
  }

  public void setIssueHavers(String issueHavers ) {
      this.issueHavers = issueHavers;
  }      

  public void onChangeFnCall1(){
      if(tasks =='reportIssue'){
          reportAppORCustomerRendered = true;
          reportAppRendered = false;
          reportCustomerRendered = false;
          issueHavers  = '--None--';
      } else {              
          reportAppORCustomerRendered = false; 
          reportAppRendered = false;
          reportCustomerRendered = false;
          issueHavers  = '';         
     }
   }

  public void onChangeFnCall2(){
      if(issueHavers =='appServers'){
          reportAppRendered = true;
          reportCustomerRendered = false;
      } else if(issueHavers =='specAccounts'){
          reportAppRendered = false;
          reportCustomerRendered = true;
      } else {
          reportAppRendered = false;
          reportCustomerRendered = false;
     }
   }           
} 

Finisher attempt 1

Method:

public PageReference getCurrentPage() {       

       PageReference pageRef = ApexPages.currentPage();
       pageRef.setRedirect(false);       
       return pageRef;
}

URL Result:

https://c.cs96.visual.force.com/apex/ReportIssue?com.salesforce.visualforce.ViewStateCSRF=VmpFPSxNakF4T0Mwd055MHpNVlF4Tnpvek5Ub3lOaTQxTWpkYSwzeVBqYlM1VldLaWNvTHdwbUdaOVRyLE1UTmpabU5t&com.salesforce.visualforce.ViewStateVersion=201807261857090143&j_id0%3AreportApp%3Aj_id23%3Ai%3Af=j_id0%3AreportApp%3Aj_id23%3Ai%3Af&j_id0%3AreportApp%3Aj_id23%3Ai%3Af%3Apb%3Ad%3Aelement___input____Description=TEST&j_id0%3AreportApp%3Aj_id23%3Ai%3Af%3Apb%3Ad%3AnavigationType=&j_id0%3AreportApp%3Aj_id23%3Ai%3Af%3Apb%3Apbb%3Afinish=Finish

Finisher attempt 2

Method:

public PageReference getCurrentPage() {       

       PageReference pageRef = ApexPages.currentPage();
       pageRef.setRedirect(true);       
       return pageRef;
}

URL Result:

https://c.cs96.visual.force.com/apex/ReportIssue?com.salesforce.visualforce.ViewStateCSRF=VmpFPSxNakF4T0Mwd055MHpNVlF4Tnpvek9Eb3hPUzR3TURoYSxiZ1ZVY2xtazNWU3J4SnhvS0FJeEdyLE1UTmpabU5t&com.salesforce.visualforce.ViewStateVersion=201807261857090143&j_id0%3AreportApp%3Aj_id23%3Ai%3Af=j_id0%3AreportApp%3Aj_id23%3Ai%3Af&j_id0%3AreportApp%3Aj_id23%3Ai%3Af%3Apb%3Ad%3Aelement___input____Description=TEST&j_id0%3AreportApp%3Aj_id23%3Ai%3Af%3Apb%3Ad%3AnavigationType=&j_id0%3AreportApp%3Aj_id23%3Ai%3Af%3Apb%3Apbb%3Afinish=Finish

Finisher attempt 3

Method:

public PageReference getCurrentPage() {       

       PageReference pageRef = ApexPages.currentPage();
       pageRef.setRedirect(true);
       pageRef.getParameters().put(tasks,'Report an Issue');
       pageRef.getParameters().put(issueHavers,'One or More App Servers');       
       return pageRef;
}

URL Result:

https://c.cs96.visual.force.com/apex/ReportIssue?appServers=One+or+More+App+Servers&com.salesforce.visualforce.ViewStateCSRF=VmpFPSxNakF4T0Mwd055MHpNVlF4TnpvME1Eb3pPUzQ0TWpKYSw5Z0xYaVgyQW9LNDZuQ09GSVRGbjc3LE1UTmpabU5t&com.salesforce.visualforce.ViewStateVersion=201807261857090143&j_id0%3AreportApp%3Aj_id23%3Ai%3Af=j_id0%3AreportApp%3Aj_id23%3Ai%3Af&j_id0%3AreportApp%3Aj_id23%3Ai%3Af%3Apb%3Ad%3Aelement___input____Description=TEST&j_id0%3AreportApp%3Aj_id23%3Ai%3Af%3Apb%3Ad%3AnavigationType=&j_id0%3AreportApp%3Aj_id23%3Ai%3Af%3Apb%3Apbb%3Afinish=Finish&reportIssue=Report+an+Issue

Finisher attempt 4

Method:

public PageReference getCurrentPage() {       

       PageReference pageRef = ApexPages.currentPage();
       pageRef.setRedirect(true);
       pageRef.getParameters().put(tasks,'reportIssue');
       pageRef.getParameters().put(issueHavers,'appServers');       
       return pageRef;
}

URL Result:

https://c.cs96.visual.force.com/apex/ReportIssue?appServers=appServers&com.salesforce.visualforce.ViewStateCSRF=VmpFPSxNakF4T0Mwd055MHpNVlF4TnpvME5EbzBOeTQwTWpoYSxaR1VFU2FTazJoeVNZSjdZRl9XUHpuLE1UTmpabU5t&com.salesforce.visualforce.ViewStateVersion=201807261857090143&j_id0%3AreportApp%3Aj_id23%3Ai%3Af=j_id0%3AreportApp%3Aj_id23%3Ai%3Af&j_id0%3AreportApp%3Aj_id23%3Ai%3Af%3Apb%3Ad%3Aelement___input____Description=TEST&j_id0%3AreportApp%3Aj_id23%3Ai%3Af%3Apb%3Ad%3AnavigationType=&j_id0%3AreportApp%3Aj_id23%3Ai%3Af%3Apb%3Apbb%3Afinish=Finish&reportIssue=reportIssue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.