6

I have a standard account salesforce page, where i have a custom visualforce page included as a section. Now i want to reload a whole standard page if the button at the custom vf-page was clicked. Is it possible?

14

While visualforce pages embedded inside standard records don't have access to any detail of the page, they can send to to another (or the same) page by setting the value of 'window.top.location'.

As you are in an account page, you want to send the browser to the account id preceded by a '/' character. You should be able to do this via an onclick handler on a commandbutton as follows:

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

Note that the onclick handler returns false - this tells the browser not to continue with the standard flow, which is to complete the postback, which can result in an interesting race condition.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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