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
SahilSFSahilSF 

Page Refresh issue.

Hi,

 

I have a custom object on which I am included a VF page. On that VF page there a command button and on click of that button a method is invoked. In that method i am performing update operation and then redirecting user to custom object again.

 

Now the issue I am facing with this is: when user clicks the button the first time everything works fine the main page (custom object) refreshes properly but when user clicks the button second time instead of refreshing the entire page it just refreshes the VF page and displays the complete custom object in there.

 

Can someone please share their thoughts around this.

 

This is the code written in the method for redirecting:

 

PageReference result = sController.view(); (where sController is nothing but the standard controller.)

result.setRedirect(true);

 

Thanks

bob_buzzardbob_buzzard

I wrote a blog post a short while ago explaining why this is and sample code for how to get around it.

 

Its available at:

 

http://bobbuzzard.blogspot.com/2011/05/refreshing-record-detail-from-embedded.html