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
ptepperptepper 

Dynamic Custom List Button Behavior Based on Current View

Hi,

 

I'm working on an application where I'd like to have a custom List Button do something different based on the currently selected list view. I have a Visualforce page that does a dynamic query and I'd like to retrieve the current view name or ID to use in this query, which I would send to the VF page by adding it as a param in the URL of the VF page called by the custom list button. 

 

The current view is identified with a URL GET param like this:

https://nan.salesforce.com/aXX?fcf=00NN000000NNnNN

 

The fcf param specifies the current view by ID (=00NN000000NNnNN).  Is there a way to get that fcf param or maybe the title of the name of the current view and pass it in a link to a VF page in a custom button?

 

In Apex, you can use getParameters to get that GET param, but in the custom button, I don't think it's possible to do it that way, because it's a PageReference method and this isn't a Visualforce page

 

I can get the params from the current URL with Javascript (window.location.search) and then parse it out of there in an OnClick function, which works fine (that's how I'm doing it now), but I wanted to check to see if anyone knows of a better way to do it besides hardcoding it into the JS.

 

Alternatively, I'm considering scrapping the built-in list view altogether and making a VF view to replace it, which would also solve the problem.

 

thanks,

-paul

 

 

Message Edited by ptepper on 09-08-2009 04:27 PM