function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
brightlaunchbrightlaunch 

redirect after successful force.com form submission

Total noob here.

 

I have a form on http://heaf.force.com/GW_Volunteers__VolunteersSignupFS

When I submit it, the empty form reloads along with a short message at the bottom of the form.

 

=> how do I redirect to a thankyou URL instead? What/where do I change that?

 

Thanks,

Uli

nathaForcenathaForce
Hi Uli,

I think that what you need is to use the setRedirect(true) method.

For example (i have not tried to comp:

public PageReference redirectToThankYouPage() {
PageReference myThankYouPage = new PageReference('/apex/ThankYou');
myThankYouPage.setRedirect(true);
return myThankYouPage;
}

and in the page:

<apex:commandButton value="Submit" action="{!redirectToThankYouPage}"/>

Let me know if that helps

Nathalie