5

I have a public website based on Flows, The page is basically:

<apex:page>
<flow:interview name="Pre_Course" buttonLocation="bottom"/>
</apex:page>

At the end of the Flow, when the user hits the finish button, The flow goes back to the starting point, So I decided to add a public URL the user would be redirected to,

Let’s say for example, but that’s not the website I’m using: Google.com

<apex:page>
<flow:interview name="Pre_Course" buttonLocation="bottom" finishLocation="{!URLFOR('http://www.google.com')}"/>
</apex:page>

But when I click on Finish, I get an unauthorized website restriction, must login!

Or when i run the page within Salesforce, i get the following error:

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.

What permissions do I need to add to my Sites “Public Access Settings”?

5
  • Perhaps you need to add the website to "remote site settings"? Try it out and let me know. I know that the system ordinarily restricts inter-domain redirects as a matter of security. Also, I'm not entirely convinced you need to use URLFOR at all.
    – sfdcfox
    Oct 17, 2013 at 21:23
  • Well i tried it and it didn't work, but i'm not sure if i need to deactivate the website and then reactivate again. But could you please explain your comment about URLFOR? do you have another suggestion how to do it? Oct 17, 2013 at 21:49
  • So i ran the page inside salesforce and it tells me: 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. Oct 17, 2013 at 23:26
  • URLFOR is best used with $Action or $Page global variables. For a normal redirection, a normal URL should work just fine, assuming its allowed. I don't know if there is a way to redirect using flows.
    – sfdcfox
    Oct 18, 2013 at 1:08
  • Yes i think its not possible too, but i submitted a case with Salesforce just to confirm. Oct 18, 2013 at 16:02

2 Answers 2

1

After working with a Salesforce rep and her co-corkers, they concluded that this cannot be done.

The rep first started by saying that it is possible to do what i want, and she did all the testing herself, and after a few hours working on it and discussing the issue with her coworkers, they all concluded that it can not be done

3
  • Could you please clean this up with some additional details? Did they tell you why it can't be done, or if it's on the roadmap? Any other information such as a case number, etc? As a prior Technical Support representative, I know that support often doesn't have all the answers in front of them or all available resources to test with, so sometimes a "this is impossible" answer isn't actually impossible. Some supporting documentation that states this would help.
    – sfdcfox
    Oct 25, 2013 at 21:37
  • Well the rep first started by saying that it is possible to do what i want, and she did all the testing herself, and after a few hours working on it and discussing the issue with her coworkers, they all concluded that it can not be done. Oct 25, 2013 at 23:04
  • 1
    Pg. 211 of the Winter '14 Visualforce Developer's Guide: "You can't redirect flow users to a URL that’s external to your Salesforce organization."
    – Adam
    Dec 25, 2013 at 22:51
0

that's right the docs does say this:

You can't redirect flow users to a URL that’s external to your Salesforce org.

We are tweaking this a bit to have a Visualforce page as the finishLocation.

<flow:interview name="My_Flow" interview="{!flow}" finishLocation="{!$Page.RedirectPage}"

Then have the RedirectPage setup like this:

<apex:page showHeader="false" sidebar="false" controller="RedirectPageCtrl" action="{!redirectExternally}">
    Please wait, redirecting...
</apex:page>

Then have the controller redirect it:

public PageReference redirectExternally() {
    PageReference pr = new PageReference('https://www.google.com/');
    pr.setRedirect(true);

    return pr;
}

It would have the annoying affect of users seeing a temporary page flash before being redirected, but if you are okay with it, then it works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .