Thanks for such a Valuable Response. Finally got Solution for this.
I creat one field on Opportunity called Refresh_Count__c and this field is used in my Batch class
When my Batch class run and Web service is called and Refresh_Count__c is Increase by 1 (Default values is 0).
when new Opportunity is Create Default value for Refresh_Count__c is 0
public class AutoRefreshOpportunity{
public Boolean refreshPage{get;set;}
private final Opportunity Opp;
public Opportunity Oppo;
// set the value to false in the constructor
public AutoRefreshOpportunity(ApexPages.StandardController stdController){
refreshPage = false;
opp = (Opportunity)stdController.getRecord();
System.debug('Opp Refresh Data::::::' + ' ' + opp);
AutoRefreshDetailsPage();
}
// This Method is Called in Constructor
public void AutoRefreshDetailsPage(){
try{
Oppo = [SELECT
id,
Refresh_Count__c
FROM
Opportunity
WHERE
Id = : opp.Id ];
}
catch(Exception Ex){
Oppo = null;
}
System.debug('Opp Refresh Data*****' + ' ' + Oppo);
if(Oppo != null){
if(Oppo.Refresh_Count__c == 0){
refreshPage = true;
system.debug('Inside IFFF::::' + ' ' + refreshPage);
}
else{
refreshPage = false;
system.debug('INSIDE ELSE ::::' + ' ' + Oppo.Refresh_Count__c + ' ' + refreshPage);
}
}
}
}
VF Page is
<apex:page StandardController="Opportunity" extensions="AutoRefreshOpportunity" tabStyle="Opportunity">
<!-- AUTOREFRESH STANDARD DETAILS PAGE OF OPPORTUNITY -->
<apex:outputPanel id="refresh" rendered="true">
<h1> Auto Refresh Opportunity </h1>
<apex:outputPanel id="refresh1" rendered="{!refreshPage}">
<script>
window.top.location='/{!Opportunity.id}';
</script>
</apex:outputPanel>
</apex:outputPanel>
</apex:page>