+ Start a Discussion
gbu.varungbu.varun 

Can a page be refreshed when a webservice is invoked.

Hi,
 
Can a Visualforce page be refreshed when a webservice is invoked. If it is possible how can I achieve this.
Vinita_SFDCVinita_SFDC

Hi,

 

How are you invoking webservice, is it through a method called on some button click? If yes then in the code of that method add this line before return statement:

 

pageRef.setRedirect(true);

 

Where pageRef is instance of PageRefernce defined in the code.

gbu.varungbu.varun

Hi Vinita, 

 

I am calling webservice on Visualforce by Javascript directly when page is loaded. I have to refresh this page by web service.

Vinita_SFDCVinita_SFDC

Hi,

 

You can reload the page through JS before calling webservice, like:

 

window.opener.location.reload();

gbu.varungbu.varun

Hi Vinita,

 

Thanks, for your kind reply but It will not work it refresh only parent window.