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
Dave BerenatoDave Berenato 

Save URL for Force.com Guest Site User

I would like to write a Save URL for a Force.com Guest Site User who completes a small form and saves it to a custom object.

I'm emailing clients a link to the form with: 

http://corere1.force.com/bkmilestone1?id={!Bankruptcy__c.Id}

I wrote a small Force.com page that basically just says "Thank you" and nothing else for when they click save.

I tried: 

http://corere1.force.com/bkmilestone1?id={!Bankruptcy__c.Id}&SaveURL=http://corere1.force.com/thankyou

But it still tries to redirect to the record which gives them the Authentication Error.

Is there a way to write the URL directly into the Visualforce page?

Here's the end of the form:
</apex:pageBlockSection>
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="Save"/>
        </apex:pageBlockButtons>
    </apex:pageBlock>
</apex:form>
</apex:page>

And I'd like it to end with http://corere1.force.com/thankyou.
Best Answer chosen by Dave Berenato
Nayana KNayana K
Sorry,  I meant extension class not custom controller. 

Give a try for something like last thread in this link :
 https://developer.salesforce.com/forums/?id=906F000000094YUIAY
 

All Answers

Nayana KNayana K
Not sure if I understood the requirement properly. I hope this helps :
Inside save() method, 
PageReference redirect = Page.Thankyou;
return redirect;

will redirect to thank you page on save. 
make sure thank you vf page is whitelisted in the site. 
 
Dave BerenatoDave Berenato
I wanted to know if there was a way to do this without a Custom Controller. That code is for a Custom Controller correct?
Nayana KNayana K
Oh Yes,  that is using custom controller. I think sites won't support saveURL stuff. 
Nayana KNayana K
Sorry,  I meant extension class not custom controller. 

Give a try for something like last thread in this link :
 https://developer.salesforce.com/forums/?id=906F000000094YUIAY
 
This was selected as the best answer