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

Flow Finish Location in VF Page - Include Field Value

I know there have been a few posts about Flow finish location but I'm still confused about the below. Read documentation but can't figure out how to add a field value for this.


My VF page code is below. I want the finish location to be "..../apex/FacilityMain?id="{{!Address_Type__c.Facility__c}


I'm not understanding how, or if, I can write the URLFOR statement below to accomplish what's in bold above.  I can only see how to either hardcode values in the URLFOR statement or put an entire field value, not a combination of both.


<!-- Calls Flow and passes variables -->
<flow:interview name="AddressSearch" buttonLocation="bottom" finishLocation="{!URLFOR('/001/o')}">  **Want to rewrite this
<apex:param name="vaentrypoint" value="EnterNewAddressType"/>
<apex:param name="vafacilityid" value="{!Address_Type__c.Facility__c}"/>
<apex:param name="vaproviderid" value="{!Address_Type__c.Provider__c}"/>



Darrell D

Best Answer chosen by Admin (Salesforce Developers) 

Check out my sample on github.


All Answers


Check out my sample on github.


This was selected as the best answer

Rajaram, thanks for sharing the code.  I am not a developer, but I was able to copy your code into my org and so far no errors.  However, I'm having a 0% test cover and have no idea how to write test cases for flow.  Can you add the test class on please? Thanks.


Even though a year later this is all I did and it's working great. 


<apex:page standardController="Account" >
    <flow:interview name="New_Account" finishLocation="/{!Account.ID}">

 My page is launched from the Account, therefore the standardController is set to Account.  Then in the Finishlocation just set it to "/[record ID]"  and that's it. 

Paul F-2Paul F-2
Exactly what I was looking for - a simple return to the invoking page. Thanks.