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
beener3beener3 

Refresh a list using Custom List Button

Hi,

I've developed a Custom List Button, to mass operate on a certain object.

this is working fine, but after the operation, I would like to refresh the list.

Any idea how to do that?

 

what I do now is reload the page using javascript, but this is slow and a bit redundant.

 

thanks.

 

Cool_DevloperCool_Devloper

Hi Beener,

 

Not sure, are you trying to do it with an S-Control or a VF page.

 

For refreshing just the list values, you can probably try to Re-Render the list instead of refreshing the whole page. So, in this case, only that particular section would be refreshed and not the whole page.

 

Cool_D

beener3beener3

Thanks, but you are acutally rephrasing my question, which is HOW do I refresh a list in Salesforce (this is not a VF page, just a std. Salesforce. page)

 

Cool_DevloperCool_Devloper

Well Beener,

 

That's what i tried to tell you. But i am afraid, you dont have many options working with the Std Salesforce pages.

 

For this, you probably need to build a custom list, which you can just reRender on the page which will save the page refresh.

 

Maybe, you would need to build a custom page and add the list component to it. On clicking the list button, you can reRender the list only and the rest page still remains the same.

 

Hope this helps!!

 

Cool_D

BenLBenL

window.location.reload();

 

 

However, what I am finding is that will refresh the first list view the user selected when they navigated to the tab ant not necessarily the list view they are on.

 

For example, if you select the lead tab and click on the 'my a prospects' list view and then change to the 'my b prospects' list view and do some kind of mass action and then call the above reload it will take you back to the 'my a prospects' list view. 

VCavallaVCavalla

BenL,

 

That is the exact problem I'm having.  Did you find any other way to refresh and still allow the user to stay on the same list view? Thanks,

 

VC

BenLBenL

Unfortunately not ;(

VCavallaVCavalla

Thanks for the response.  I did a bit more digging and this seems to be working:

 

document.getElementsByName('fcf').item(0).onchange();

(please beware when copying the above code, there "appears" to be an invisible character between the last 'e' and '(' characters)

 

By calling the onchange() method of the view select box, you can force a refresh of the current view.

 

It looks like the name of the select tag is the easiest way to find the tag since the ID will change.