Find your content:

Search form

You are here

retURL is not working


I have a VF page and it is associated with standard controller. On the page, I am using apex:detail tag to bring all the details. I also want to show few related list, So I used apex:relatedlist. This all works fine. The only thing which is problemtic is when I click on "New" button on related-list to create a new record after saving the record it doesn't bring me back to the original VF page, instead it takes me to the detail-page of related-list record. Any thoughts what wrong I am doing?

<apex:page standardController="Account">
You're looking at some related lists for {!}:</apex:pageBlock>
<apex:relatedList list="Opportunities" />

<apex:relatedList list="Contacts">
    <apex:facet name="header">Titles can be overriden with facets</apex:facet>

<apex:relatedList list="Cases" title="Or you can keep the image, but change the text" />

Attribution to: doga

Possible Suggestion/Solution #1

This question has been asked before in a slightly different way, but the answers and sample code I believe still apply. Check out, Redirecting back to original page using visualforce.

Attribution to: Andrew Fawcett

Possible Suggestion/Solution #2

Since you are using standard controller, your save will behave the way it behaves when you save a record. And the problem here is, you cant override your Save button. You'll need to create a vf page and implement the save in your controller for that page.

Attribution to: Shailesh Deshpande
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content