function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TAPSFDCYYCTAPSFDCYYC 

Pass user ID via Visualforce page?

I've create a flow and have launched it via a VisualForce Page.  With buttons and links you can pass the parameter of the user id running the flow.  Can you pass this same parameter using the VFP?  I tried the below VFP code with no luck.  In my flow the "varId" parameter is set to Input only.

 

<apex:page standardController="User" >
<flow:interview name="Account_Approval_Flow" finishLocation="{!URLFOR('/home/home.jsp')}"/>
<apex:param name="varId" value="{!User.id}"/>
</apex:page>

 


Cheers

TP

RajaramRajaram

For the Apex param tag, you need to make it INSIDE of the flow tag

 

So, you need to change 

 

<flow:interview name="<flowname>"/>
<apex:param name="<name>" value="<value>"/>

 

TO

 

<flow:interview name="<flowname>"> 
<apex:param name="<name>" value="<value>"/>

</flow>

 

Further, if you want to get the user ID fo the current user, you can just do this:

 

<apex:page >
<flow:interview name="Account_Approval_Flow" finishLocation="{!URLFOR('/home/home.jsp')}"/>
<apex:param name="varId" value="{!$User.id}"/> 
</apex:page>

 

 

 

 

SinCitySinCity

In my flow, if I use my custom link, the flow captures the userID and populates the record I am creating. 

/flow/AA_Quiz_1?varCurrentUserID={!User.Id}

 

If I access the flow via visualforce page, when the record for the flow is created it does not capture the userID.  What am I missing?

 

<apex:page >
  <flow:interview name="AA_Quiz_1" finishLocation="{!URLFOR('/home/home.jsp')}"/>
  <apex:param name="varCurrentUserID" value="{!$User.Id}"/>
</apex:page>

SinCitySinCity

Duh....I was missing the </flow:interview>