+ Start a Discussion
ThomasTTThomasTT 

List button on Task Related List

I'd like to put a List button on Task related list. For example, when user opens Account detail page, there is a Task related list which shows all Tasks related to the Account. I'd like put a button on the related list with checkboxes for multi-selection (of Tasks).

And, I'd like to use a VF page for the button.

So, if I go to the Task Custom Buttons & Links configuration page, I see "List Button" and "Visualforce page", but the "Visualforce page" picklist doesn't show anything.

Because, to show VF page in the list, that VF page must be using Task StandardSetController, but StandardSetController doesn't support Task. if this is Detail page button, that has to be Task Standard Controller so that's ok. So it's impossible to put VF page on the List button, isn't it?

Is there anyway to use VF page for Task List button?

Only thing I came up is to use OnClick javascript and GETRECORDIDS function, and concatinate the ids and document.location.replace("/apex/MyVFPage?ids="+ids). Is this the only way? This is ok to me, but if there is anyway to directly use VF Page, I'd like to know.

Thank you in advance.

ThomasTT

Message Edited by ThomasTT on 10-09-2009 06:41 PM
jkucerajkucera

I ran into this problem yesterday - you need a list controller for the VF page for it to pop into the available pages for a related list button.

 

Check out StandardSetController in the Apex guide for how to create the controller.  

 

I'm not sure this will work for tasks though as I don't believe objects without list views can have list controllers (for example - campaign member can't).