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
MktdevMktdev 

Refreshing Salesforce from homepage component containing VF page

Hi,

 

I need a help to refresh my salesforce page with a button in a VF page placed in home page component.

 

My VF page just has one button called Refresh. This VF page is placed in Home pagecomponent as HTML type using iframe tag.

 

I want to refresh the complete page on click on this button.With below javascript I able to refresh salesforce with I am in VF page(https://c.ap1.visual.force.com/apex/abc) in the URL but it doesnt work when we have standard salesforce page(https://ap1.salesforce.com/home.jsp).

 

<script>

parent.location.reload();

</script>

 

Please suggest.

 

BharathimohanBharathimohan

Hi,

 

I believe that you want to reload/refresh the Home Page on clicking the "Refresh" button in the Home Page Component.

If so, please try the below script

 

<apex:commandButton value="refresh" onclick="top.location.href='/home/home.jsp'" />

 

( OR )

 

<script>

function refresh()

{

        top.location.href='/home/home.jsp';

}

</script>

<apex:commanbutton onclick="refresh()" />

 

Please let me know if you face any issues still, else mark this post as solved for the benefit of others.

 

Regards,

Bharathi

Salesforce For All