1

I've built a visual workflow to populate an sobject variable and carryout an interview. I need to take it a bit farther and provide the functionality to: 1) Use a visualforce page to perform a SOQL query 2) Select a record from the SOQL query results 3) Pass the selected record into the sObject variable in the visual workflow. 4) Initiate the visual workflow

I've build the visualforce page and controller to complete 1) and 2) but i dont know how to take the next step to actually pass the selected record from the SOQL query results into the sObject variable in the Visual Workflow. Right now I'm also using "apex:inputCheckbox" to select a record from the SOQL results - but im not sure if this is the correct way to select the record. Below is my visualforce and my controller. Can someone help me understand how to pass this variable into my flow?

I've taken a try at passing the value into the flow in the "flow:interview" part of the VF page below but it is not working.

<apex:page Controller="ribbonClauseSearchController" > 
 <apex:form > 
 <apex:inputText value="{!searchstring}" label="Input"/> 
 <apex:commandButton value="Search records" action="{!search}"/> 
 <apex:commandButton value="Clear records" action="{!clear}"/> 
 <apex:pageBlock title="Search Result"> 
 <apex:pageblockTable value="{!rClauseList}" var="rc"> 
    <apex:column headerValue="Action">
        <apex:inputCheckbox value= />
        </apex:column>    
    <apex:column value="{!rc.name}"/> 
    <apex:column value="{!rc.id}"/>
    <apex:column value="{!rc.Text__c}"/> 

 </apex:pageBlockTable> 
 </apex:pageBlock> 
 </apex:form> 
     <flow:interview name="Vf_page_value_flow"
          finishLocation="{!URLFOR($Action.RibbonClauses__c.Tab, $ObjectType.RibbonClauses__c)}">
        <apex:param name="soc_RibbonClause" value="{!Selected}"/>
        <apex:param name="v_UserId" value="{!$User.Id}"/>
    </flow:interview>
 </apex:page>

Here is the controller that i have created up to this point:

public with sharing class ribbonClauseSearchController { 
    public String getSelected() {
        return null;
    }


public list <RibbonClause__c> rClauseList {get;set;} 
public string searchstring {get;set;} 
public ribbonClauseSearchController ( ) { 
} 
public void search(){ 
string searchquery='select name,id,Text__c, Clause_Name__c, Additional_NST_Details__c from RibbonClause__c where Name like \'%'+searchstring+'%\' Limit 20'; 
rClauseList= Database.query(searchquery); 
} 
public void clear(){ 
rClauseList.clear(); 
} 
}

Can someone assist me in passing the value into the variable in my flow?

closed as off-topic by glls, Santanu Boral, Ratan Paul, Samuel Dare, Martin Lezer Oct 23 '17 at 7:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on problems in code you've written must describe the specific problem and include valid code to reproduce it. For help writing short, self-contained syntactically-valid examples, see: SSCCE.org" – glls, Santanu Boral, Ratan Paul, Samuel Dare, Martin Lezer
If this question can be reworded to fit the rules in the help center, please edit the question.