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
Vasu.PVasu.P 

How to Auto Refresh a Standard Visual force page when an Workflow field update will happen

Hi All,

i have a standard opportunity page. also i have a field update on this. so i have to auto refresh my opportunity page when a field update happen. now i need to manully refresh the page. how can i achieve this. i have written a inline visual force page with a 'Reload' button embadded with the satndard page. but i need to manually click this button. i need the auto refresh the page.

Thanks,
LBKLBK
Hi Satya,

You have to use apex:actionPoller component to run a server-side code piece executed on a specific time interval (probably every 5 seconds).

When your workflow updated the required field, your apex:actionPoller will automatically refresh the page.

Your code will look like this.
<!--  Page -->
			
<apex:page controller="myController">
    <apex:form>
        <apex:actionPoller action="{!watchWorkflowUpdate}" interval="15"/>
    </apex:form>
</apex:page>
			
			
/***  Controller: ***/
			
public class myController {
    		
    public PageReference watchWorkflowUpdate() {
		if(true){
			return new PageReference("YOUR_VF_PAGE_WITH_PROPERQUERYSTRING")
		}
		else{
			return null;
		}
    }
			
}
Hope this helps.
 
Vasu.PVasu.P
Hi,- my page is a Standard Opportunity page. in the page it self i have a field update then how can i implement this.

Thanks,
Anjum Attar 26Anjum Attar 26
If it is a standard opportunity page and you have written a workflow rule for field update then after clicking on save button u will be able to see all the changes there is no need to refresh the page.
LBKLBK
If you are triggering the workflow on click of a button in the Page Layout, it will automatically refresh.

However, if the workflow is independent of the page layout you are in (for example, time bound), you have to have a small VF component added in your page layout with the above code.

This VF component will take care of the auto refresh, once you add the right condition.
Chethan SNChethan SN
Hi Vasu.P,
Did you find the soluton ? 
I am stuck with similar issue. 
Please let me know the solution if  you have found.