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
Alpesh Patel 16Alpesh Patel 16 

How to display visualforce page in list of custom object

Hi!
I have created one custom object. I have added list of this object in tab menu. I need to add two buttons in listing page so I have created visual force page. I am trying to configure this page in list page but I am not getting my page in listing.
User-added image

User-added image

I did following code in visualforce page.

<apex:page Standardcontroller="Contract_History__c" extensions="ContractHistoryListController">
    <apex:form >
        <apex:pageblock >
          <center><apex:outputText rendered="{!(ContractHistoryList.size = 0)}" style="font-weight: bold;" value="There are no records available in a contract history." /></center>          
        <apex:pageblockTable value="{!ContractHistoryList}" var="c" id="CHTable" rendered="{!(ContractHistoryList.size != 0)}">    
           <apex:column headerValue="Name">
                   <apex:outputlink value="https://cs1.salesforce.com/{!c.id}" >{!c.Name}</apex:outputlink>
                </apex:column>
       <!-- <apex:column value="{!c.Name}"/>-->
        <apex:column value="{!c.Account_Name__c}"/>
        <apex:column value="{!c.Contract_User_Name__c}"/>
        <apex:column value="{!c.Contract_Name__c}"/>
        <apex:column value="{!c.Contact_Name__c}"/>
        <apex:column value="{!c.Type__c}"/>
        <apex:column value="{!c.Status__c}"/>
    </apex:pageblockTable>
            <apex:pageBlockButtons location="top">
       
                <apex:commandButton value="Migrate Contract Users" id="btnContractUsers" action="{!AddContractUsersToContractHistory}" oncomplete="window.opener.location.refresh();" />                              
               
                <apex:commandButton value="Migrate Contract Members" id="btnContractMembers" action="{!AddContractMembersToContractHistory}" oncomplete="window.opener.location.refresh();" />                          
                

        </apex:pageBlockButtons>      

         </apex:pageblock>
    </apex:form>
</apex:page>

Please help me.

 
Arunkumar RArunkumar R
Hi Alpesh,

In order to Override List option or List Button, then you need to add recordSetVar attribute in your visualforce page.

For example, 

If you are going to override account list view means, your page should like below,
 
<apex:page standardController="Account" recordSetVar="accounts">

You can give any name in the place of recordSetVar.

Learn more about,

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_sosc_associate.htm

http://www.infallibletechie.com/2012/10/recordsetvar.html