You need to sign in to do that
Don't have an account?
Odd redirect behavior on a force.com site
Hey all,
I am very familiar wth Visualforce but this is my first time developing a Force.com site and an external page. I have a page that displays information about a custom object (Subscription__c). The details of the object aren't important. Now, the start page for a user to change their preferences is actually a redirect page. It checks for an id specified in the URL parameters and if it is supplied and valid the user is redirected to a second page. When I tested the page internally (with the URL /apex/MyPageName) everything works fine, the CSS looks good, the fields are all filled out with the data from the object ... etc. However, when I try to access the page externally using the domain name I lose all the CSS styling, the static resources (like any images) and also the fields do not get populated because I think the constructor for my VF page controller is getting called a second time when redirecting to the 2nd page (I am not using setRedirect(true) so that should not happen). I have a feeling there is something different going on under the hood when using Force.com versus internal VF pages but I can't figure it out. Anyone familiar with Force.com pages and have any ideas? I posted some code in the posts below.
Nevermind guys I found an old post that solved the issue. My custom object's status was "In Development" instead of "Deployed". Another example of lack of Documentation on SF's side. Glad we have good people watching the forums.
All Answers
The controller:
The VF page that redirects the user:
Nevermind guys I found an old post that solved the issue. My custom object's status was "In Development" instead of "Deployed". Another example of lack of Documentation on SF's side. Glad we have good people watching the forums.
Hi Dave,
We are facing a similar problem.
When the VF pages were moved to Site, the redirection that was working fine fails to work anymore.
The requirement is that we need to traverse across some 4,5 pages capturing the user entry in each and carrying it till the last page where we are doing a save to an object.
I have associated the same controller with all pages and redirecting using:
PageReference redirect = new PageReference('/apex/survey3');
return redirect;
This works fine before moving to Sites.
But once moved to Sites, it doesn't redirect at all, just refreshes the same page.
When the code is changed as below, it redirects but the view state is not maintained I guess and hence the values are not carried over as required.
PageReference redirect = new PageReference('/survey3');
return redirect;
Could you provide any information on what might be wrong ?
Thanks in advance.
Regards,
Lakshmi.