You need to sign in to do that
Don't have an account?
lrw757
Pagereference not Redirecting
For some reason, I can't get a custom visualforcepage to redirect. I can't see anything wrong with my code. I've debugged and it's entering the function, it's returning the right url, it just isn't redirecting. The page doesn't even reload. I am calling the function conditionally from a constructor.
public pagereference redirect(){
pagereference intermediatePage = Page.PMSprintIntermediatePage;
intermediatePage.setRedirect(true);
return intermediatePage;
}
Any thoughts?
Weird. For some reason, it was performing the logic of whether to redirect in one function and calling the actual redirect as a separate function that was giving me the problems. As soon as I combined them in a pagereference and set the other conditions to return null, it worked. Call me confused.
All Answers
fyi I've just tried pulling it out of the constructor and it's still giving me the same response.
Weird. For some reason, it was performing the logic of whether to redirect in one function and calling the actual redirect as a separate function that was giving me the problems. As soon as I combined them in a pagereference and set the other conditions to return null, it worked. Call me confused.