Wednesday 23 January 2013

Reload Standard Detail page from Inline VF

07:58
 
visualforceI just faced a small block, Pretty simple once you've figured it out, Thought of sharing it and saving time for us in the future. Most of the time we require to reload the Standard Page following an  action on the inline VF Page. The solution to this was not apparently available to me when I needed it. Usually after clicking on a link or button we need to refresh the standard (parent page) the VF page is in. Read more on how to add inline VF Pages

Problem: A VF page is inline on a standard detail Page, On click of button inside VF Page, Reload the standard Detail Page once action completes in the Inline VF page


Solution : I tried the parent.location property in the oncomplete event, but didn't seem to work as expected Listed below are couple of similar solutions that work.

1) Set the Target attribute on the command link
<apex:commandLink value="Save" target='_Top'/>


2)
<apex:commandButton value="Refresh" onclick="window.top.location='{!Account.id}'; return false" >


Hope this saves time for some of us in the future. Do let me know if you’ve other solutions.
Resources
What is Visualforce?
Visualforce Developer’s Guide
Inline VF page- How To Video