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
Andrew2XAndrew2X 

Object-agnostic Visualforce page?

Is this possible? I want to add a Custom Button to the List View for Accounts, Opportunities, Leads, etc. When the button is clicked a VF page is navigated to, and some processing occurs, and this processing doesn't care what object is being listed--it just saves a list of the object Ids that the user has selected (checked) from the list.

 

As it is, I have to create a separate VF page for each Object and put

 

 

<apex:page standardController="Account" extensions="MyListController" action="{!init}" recordSetVar="items"

 

Then I have to do another page for Opportunites where the only difference is standardController='Opportunities'

 

Also, this makes it impossible to use the Custom Button on List View's of Custom Objects since a new VF page would have to be created for each Custom Object that supports the Button on their lists.