You need to sign in to do that
Don't have an account?
How to display a simple "Thanks" message on completion of a Sites-based feedback form
Hi
I'm completely new to force.com Sites and VF
This is my first attempt. I used easypage to generate the VF.
I'm in a prelive sandbox at present.
http://cambridge.prelive.cs13.force.com/AcademicFeedback/a1fW000000006RO
On clicking "Save" it displays the "Authorisation required" page!
It does create the feedback record fine, which is cool!
I'd like it to show a simple "Thanks for your feedback" message.
Any idea how you do this?
<apex:page standardController="Academic_Customer_Feedback__c" standardStylesheets="{!if($CurrentPage.parameters.css == 'std',true,false)}" showHeader="{!if($CurrentPage.parameters.css == 'std',true,false)}" >
<apex:sectionHeader title="{!$ObjectType.Academic_Customer_Feedback__c.label} Edit" subtitle="New {!$ObjectType.Academic_Customer_Feedback__c.name}"/>
<apex:form >
<apex:pageBlock title="{!$ObjectType.Academic_Customer_Feedback__c.label} Edit" mode="edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection showHeader="true" title="Customer Details" columns="2">
<apex:pageBlockSectionItem >
<apex:outputLabel value="Academic Customer Feedback Owner"/>
<apex:outputText value="{!Academic_Customer_Feedback__c.Owner.Name}"/>
</apex:pageBlockSectionItem>
<apex:inputField value="{!Academic_Customer_Feedback__c.Opportunity__c}"/>
<apex:pageBlockSectionItem />
<apex:inputField value="{!Academic_Customer_Feedback__c.Contact__c}"/>
<apex:pageBlockSectionItem />
</apex:pageBlockSection>
<apex:pageBlockSection showHeader="true" title="1. Course Details" columns="1">
<apex:inputField value="{!Academic_Customer_Feedback__c.Module_Name__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Module_Code__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Level_of_Module__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Number_of_Students__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Module_Start_Date__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Other_Colleagues_involved_in_decision__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Current_textbook_s_in_use__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Local_BookSeller_s__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Your_Email__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection showHeader="true" title="2. Your Feedback" columns="2">
<apex:inputField value="{!Academic_Customer_Feedback__c.Adopted_main_text__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Recommended_background_reading__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Adopted_one_of_two_main_text__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Not_adopted__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Recommended_one_of_several_texts__c}"/>
<apex:pageBlockSectionItem />
</apex:pageBlockSection>
<apex:pageBlockSection showHeader="false" columns="1">
<apex:inputField value="{!Academic_Customer_Feedback__c.Why_are_you_adopting_the_book__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.If_not_adopting_then_why__c}"/>
<apex:inputField value="{!Academic_Customer_Feedback__c.Any_Other_Suggestions_for_Improvement__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection showHeader="true" title="3. More Information" columns="2">
<apex:inputField value="{!Academic_Customer_Feedback__c.What_else_can_Cambridge_do_for_you__c}"/>
<apex:pageBlockSectionItem />
<apex:inputField value="{!Academic_Customer_Feedback__c.Receive_information_about_related_titles__c}"/>
<apex:pageBlockSectionItem />
</apex:pageBlockSection>
<apex:pageBlockSection showHeader="true" title="Information" columns="2">
</apex:pageBlockSection>
<apex:pageBlockSection showHeader="true" title="System Information" columns="2">
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
The standard controller save will take you to the view page of the newly created record by default, and you'll need authorization for that. To work around this, simply create an extension controller that invokes the standard controller save and then redirects to a thanks visualforce page instead of the standard view.
Something like:
You'll need to create a VF page named 'thanks' and change your main page markup to add the extension controller:
All Answers
The standard controller save will take you to the view page of the newly created record by default, and you'll need authorization for that. To work around this, simply create an extension controller that invokes the standard controller save and then redirects to a thanks visualforce page instead of the standard view.
Something like:
You'll need to create a VF page named 'thanks' and change your main page markup to add the extension controller:
Perfect solution. Many thanks bob_buzzard.
It is just worth noting that I needed to add the thanks page to site pages list for it to work.