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've customized the Account Detail page by adding a VF (child) page to the Account layout.

On the child page I've added a CommandButton which is bound to a method which returns a page reference to a another page, with setRedirect(true).

    PageReference pr = Page.CustomSearch;
    pr.setRedirect(true);
    return pr;

However, when I click the button to redirect to CustomSearch page, only the portion in which the child page is displayed is updated with the contents of the CustomSearch page.

How do I force it to redirect the browser, instead of doing the partial update?

share|improve this question
    
i would try window.parent.location.href = ' ' in javascript, don't reckon you will be able to do it via a controller. Invoke a Js function onComplete of button click to redirect –  techtrekker Jan 15 '13 at 15:24
add comment

1 Answer 1

I wrote a blog post, including sample code, on exactly this topic at:

http://bobbuzzard.blogspot.co.uk/2011/05/refreshing-record-detail-from-embedded.html

Note that this won't work from the Service Cloud Console.

share|improve this answer
    
Thank you! A clever solution indeed. Still, not what I would like. I really don't want to include a VF page in the layout. I need some mechanism which I can easily bundle into a package, which can show some custom fields/actions added to account object. Do you think a Custom Component would be a better solution for this, so we don't get into this iframe prob? –  BuddhiP Jan 15 '13 at 15:50
1  
An apex component won't do the trick - these can only be used inside visualforce pages. If the fields and actions are available outside of visualforce, is there any reason why you can't just add another section to the page layout? –  Bob Buzzard Jan 15 '13 at 16:29
    
Ok, my condition is whatever method I use it should be easily manageble, i.e I should be add all the fields to the detail page at once without having to add field by field, and this customization should be easily packageble, and updatable in future. To me it looked as if VF page provides all of these, but with other issues? Can 'section' provide answers to my concerns? (In case you didn't notice I'm very new to SF) –  BuddhiP Jan 15 '13 at 16:35
1  
Using the page layout editor, you can add a custom section into the page and group your buttons and fields there. However, users would have to use this page layout so they would still need to do some configuration. –  Bob Buzzard Jan 15 '13 at 16:40
add comment

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.