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;
    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?

  • 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 Jan 15 '13 at 15:24

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


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

  • 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? 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. Jan 15 '13 at 16:40

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .