[SalesForce] Redirecting user to a VF page after executing site.login

We are using force.com sites to build a application portal. Customer portal is being used in conjunction to enable self registration.

When a user tries to login … we are executing the force.com site method like below

PageReference p = Site.login(username, password, '/apex/VF_ApplicantHomePage?Id=005J0000001HVIK');
return p;

However, I get an error when I try to login which says
Error: Error occurred while loading a Visualforce page

The URL formed after login action is

https://.cs10.force.com/ApplicationSubmission/VF_ApplicantHomePage?Id=005J0000001HVIK

Has anyone done the same thing? Can you suggest the work around?
Thanks!

Best Answer

Can you check once site has access to the VF_ApplicantHomePage , if not add this vf page to sites through

Develop -> Sites-> Force.com Site -> Set Visualforce Page

Even if error also comes, need to check on the permissions on the objects used in the vf page for the profiles used for site login.

Related Topic