Is there any pattern for passing parameters into a list view?
For example if I wanted to display Tasks with a Status of "In Progress" the URL could be something like:
https://na3.salesforce.com/007?Status=In+Progress
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityYou can, actually, change the list view criteria dynamically. Start by pulling up the list view you want to call and clicking into the Edit screen for it. Here you need to do 2 things:
3. Look for the input id that shows up in the developer tools section. Copy it. Repeat for as many filter values as you'll be passing (and remember the order so that you can pass your data into the right filters).
When I did this for an Activities list view, the input ids were "fval1", "fval2", etc.
To build your url for your link or button, you need to start with the url you copied from the edit page. Mine looked liked this:
https://cs20.salesforce.com/ui/list/FilterEditPage? id=00Bm0000000Zt9H&retURL=%2F007%3Ffcf%3D00Bm0000000Zt9H %26rolodexIndex%3D-1%26page%3D1
You can actually delete the part of the url after the second repetition of your list view id. The list view id has been bolded in my url above, and the part you can delete has been italicized.
To add your dynamic criteria, follow the same principles as regular url passing but with the input id(s) you identified earlier, **making sure to add a Save parameter*. In my example, I want to open a list view with all activities related to the Account the button is on: https://cs20.salesforce.com/ui/list/FilterEditPage?id=00Bm0000000Zt9H&fval1={!Account.Name}&save=1&retURL=%2F007%3Ffcf%3D00Bm0000000Zt9H
A few final notes:
One thing you can do is define your list and filter and then call it using URL.
https://na3.salesforce.com/00Q?fcf=00B90000008505L
here fcf=XXXX is the id of list view.
Note that the criteria is predefined and can not change dynamically.
If you wan to to change filter dynamically then you will have to write your custom page with VF & APex.
According to a post on the Success Community https://success.salesforce.com/answers?id=90630000000hddHAAQ this no longer works.
... based on a thread started by Natalie Regier[1], it appears that the autosave URL hack no longer works. Due to the fact that the process was indeed a hack, using an undocumented URL parameter, salesforce.com exercised its right to remove the "feature" due to security concerns.
At this point, I recommend using the AJAX Toolkit[2] to implement the same feature you described. Unfortunately this will require you to write JavaScript, which I understand may be a deterrent for some organizations. You can probably search online to find an example[3] or two demonstrating the AJAX Toolkit.
[1]: thread started by Natalie Regier (https://success.salesforce.com/0D53000001OeoxV) [2]: AJAX Toolkit (http://www.salesforce.com/us/developer/docs/ajax/index.htm) [3]: an example (http://pastebin.com/UqmQWvfX)