function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KeithJKeithJ 

Visualforce page refresh

Hi there. Is anyone aware of a way to refresh an opportunity detail page from a visual force page?

I have a standard opportunity detail page that when you click a button, it opens a visual force page in its own window.

When a button is clicked I want to refresh the opportunity detail page from the visual force page.

Is this possible?

Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
KeithJKeithJ

Got it.

I had to create a vf page for my SObject detail view and I could then use javascript to do 

 

onclick="window.close();window.opener.location.reload();"

 

 from my child vf page as both pages (child and parent) are on the same domain.

Regards

 

All Answers

Ron HessRon Hess

they are in seperate domains, however you can try this in your VF page:

 

 

<apex:page StandardController="Account" ><apex:form > <apex:commandLink value="click me" onclick="window.parent.location.href='/{!account.id}';" /> </apex:form></apex:page>

 

 

the parent.location.href is one thing that is settable across domains, so this loads (reloads) the parent.

 

KeithJKeithJ

Thank so you so much Ron,

Regards

KeithJKeithJ

Unfortunately that doesn't work Ron.

I know that vf pages are now hosted on a seperate domain - would that have any implications?

Thanks

KeithJKeithJ

Got it.

I had to create a vf page for my SObject detail view and I could then use javascript to do 

 

onclick="window.close();window.opener.location.reload();"

 

 from my child vf page as both pages (child and parent) are on the same domain.

Regards

 

This was selected as the best answer