Invalid Page Redirection in VF page when URLFOR function is used
Last updated 2022-01-19 ·Reference W-8056510 ·Reported By 11 users
In Review
Summary
When the critical Update ‘Stabilize URLs for Visualforce, Experience Builder, Site.com Studio, and Content Files’ is enabled, then URLFOR function is failing when this is used in the finishLocation of <apex:flowInterview> tag
Error Message
=============
Invalid Page Redirection The page you attempted to access has been blocked due to a redirection to an outside website or an improperly coded link or button. Please contact your salesforce.com Administrator for assistance. For more information, see Insufficient Privileges Errors. Click here to return to the previous page.
Repro
1.Create a sample screen flow
2.Create simple VF page like this
<apex:page standardController="Account
<apex:form >
<apex:pageBlock >
<apex:outputField value="{!Account.name}"/>
<apex:outputField value="{!Account.AccountNumber}"/>
<apex:outputField value="{!Account.Type}"/>
<apex:outputField value="{!Account.Industry}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
3. Create a VF page as shown
<apex:page >
<flow:interview name="VFFlow" finishLocation="{!URLFOR('/apex/getcurrentaccs?', null, [id='0012v00002juR66AAE'])}"/>
</apex:page>
Replace the flow and the vf page names with the component names created from step 1 and 2 in 3.
4. Activate the critical update and observe the error.
5. Deactivate the critical update and see the correct navigation.
Workaround
No Workaround
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.