Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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" />

share|improve this question
2  
I think this is the standard behaviour.You may overwrite standard Save button to change the navigation back to parent view . –  Mohith Shrivastava Nov 26 '12 at 4:04
    
Does this mean I have to create another VF page for creating New Record and inside controller I will have to override save? –  doga Nov 26 '12 at 4:13
    
Ya that can be done as well.But you can override save action as well .Override the Save Action –  Mohith Shrivastava Nov 26 '12 at 7:24

2 Answers 2

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.

share|improve this answer
3  
Intrestingly both the questions are by the same user :X!!! –  rao Jan 25 '13 at 17:59

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.