0

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.

enter image description here enter image description here

Please help me.

Following is the code of 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>

1 Answer 1

0

Add recordSetVar attribute on your component. This is required for overiding the list button. The fist line in VF page should look like this <apex:page Standardcontroller="Contract_History__c" recordSetVar="list_contacthistory" extensions="ContractHistoryListController">

More about recordSetVar http://salesforcedeveloperblog.blogspot.in/2011/07/recordsetvar-tag-in-visualforce-page.html.

If this helps you mark it as answer.

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.