Find your content:

Search form

You are here

retURL is not working

 
Share

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">
<apex:pageBlock>
You're looking at some related lists for {!account.name}:</apex:pageBlock>
<apex:relatedList list="Opportunities" />

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

<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 https://salesforce.stackexchange.com/questions/4752

My Block Status

My Block Content