7

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
5

You 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:

  1. Copy the URL.
  2. Right click on the criteria field where you'll be passing in a value. Click on Inspect Element. (Note: I've only tried to set the filter values via parameter passing, not the field or operators. Also, these steps are for Chrome.)

Inspect Element for Filter Value 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).

Locate Input ID via Developer Tools

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:

  1. The retURL will load the list view after the edit you passed in is saved.
  2. Make sure you've saved your list view with the Filter field(s) and operator(s) already set!
  3. This process modifies this list view every time a user clicks your custom link/button, so if accessed through a tab, it will display the most modification. (I haven't tried it, but you may be able to use the List View name - fname/devname - in your url to somehow create a new list view with every click or for each user, but that could very quickly get out of hand.)
  4. This same thing can be done via parameter passing to a report, and probably fulfills your business requirements better and more easily.
5

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.

-2

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)

  • 1
    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. – Jenny B Mar 19 '15 at 16:03
  • @JennyB I believe this is meant as a response to the selected answer. Since the user didn't have enough repoutation, he was not allowed to comment. – Charles Koppelman Aug 16 '16 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.