+ Start a Discussion
CloudGeekCloudGeek 

How to add custom button to AccountDetail overwritten page or layout ?

Hi,

For account detail screen, it's been identified that it is overwritten bya VF page,

apex/AccountDetailOverride?id=001190000087LKcAAM   -----This is the URL I found on account view record

But I go see the VF page code I do nto see any Edit button code or something , Still I see Edit button on record View 

User-added image

VF Page Code is :
<apex:page standardController="Account" extensions="AMindSwitchContextControllerExt" sidebar="true" showHeader="true" id="acctDetail">
    <apex:includeScript value="{!$Resource.cometd}"/>
    <apex:includeScript value="{!$Resource.jquery_cometd}"/>
    <apex:includeScript value="{!URLFOR($Resource.treeviewGrid2983, 'jquery.min.js')}" />
    <apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"/>
    <script>
        var j$ = jQuery.noConflict();
        j$("iframe").each(function(){
            j$(this).load(function() {
                j$(this).height(j$(this).contents().find("body").height() );
            });
        });
    
        function setFocusOnLoad() {}

        console.log("About to init cometd");

        var sFjQuery$ = jQuery.noConflict();

        // Connect to the CometD endpoint
        sFjQuery$.cometd.init({
          url: window.location.protocol+'//'+window.location.hostname+'/cometd/24.0/',
          requestHeaders: { Authorization: 'OAuth {!$Api.Session_ID}'}
        });

        // Subscribe to the push topic
        sFjQuery$.cometd.subscribe('/topic/DiscountApprovalUpdates', function(updates) {
            console.log(updates);
            quote = updates.data.sobject;
            action = quote.Discount_Approval_Status__c;
            quoteId = quote.Siebel_ROW_ID__c;
            var message = '{"action":"' + action + '","quoteId":"' + quoteId + '"}';
            var receiver = window.open("", "Quote Preview");
            receiver.postMessage(message, "*");
            console.log(message);
        });
    
    </script>
    <chatter:feedwithFollowers entityId="{!Account.Id}"/>
    <!--<c:HoverHeader />-->
    <c:HoverHeader />
    <apex:detail relatedList="false" inlineEdit="true" showChatter="false" relatedListHover="false"/>
    
    <apex:include pageName="accountRelationViewer"/>
    <apex:relatedList list="Renewals__r" rendered="{!$ObjectType.Renewals__c.accessible}" id="Renewals"/>
    <apex:relatedList list="Contacts" id="Contacts" rendered="{!$ObjectType.Contact.accessible}"/>
    <apex:relatedList list="Addresses__r" rendered="{!$ObjectType.Address__c.accessible}" id="Addresses"/>
    
    <apex:pageBlock rendered="{!($ObjectType.Asset.accessible)}">
    <apex:outputlabel style="display:block; font-size: 1.2em; font-family: Arial,Helvetica,sans-serif; font-weight: bold;"> Products and Services </apex:outputlabel>
    <apex:outputPanel >
        <div style="display: inline-block;">
        <c:AssetRelatedList accountid="{!account.Id}" accountname="{!account.Name}"/>
        </div>
    </apex:outputPanel>
    </apex:pageBlock>
    
    <apex:pageBlock rendered="{!($ObjectType.Asset.accessible)}">
    <apex:outputlabel style="display:block; font-size: 1.2em; font-family: Arial,Helvetica,sans-serif; font-weight: bold;"> Online Subscriptions </apex:outputlabel>
    <apex:outputPanel >
        <div style="display: inline-block;">
        <c:OnlineSubscriptionRelatedlist accountid="{!account.Id}" accountname="{!account.Name}"/>
        </div>
    </apex:outputPanel>
    </apex:pageBlock>
    <apex:outputPanel rendered="{!($ObjectType.Asset.accessible)}" >
        <div >
            <c:QuoteRelatedList />
        </div>
    </apex:outputPanel>
    <!-- SFDC-964, SFDC-841: create session with invisible canvasApp prior to JSON call -->
    <apex:canvasApp applicationName="Application_v1" parameters="{canvasSource:'Start',sfdcInConsoleUI:'{!aMindSwitchContextInConsole}',discountThreshold:'{!$User.Discount_Threshold__c}'}" width="0" height="0" maxHeight="0" maxWidth="0" />
    <apex:relatedList list="Activation_Codes__r" rendered="{!$ObjectType.ActivationCodes__c.accessible}" id="ActivationCode"/>
    
    <apex:relatedList list="AccountTeamMembers" rendered="{!$ObjectType.AccountTeamMember.accessible}" id="AccountTeamMembers"/>
    <apex:relatedList list="Career__r" rendered="{!$ObjectType.Training__c.accessible}" id="Careers"/>
    <apex:relatedList list="Opportunities" rendered="{!$ObjectType.Opportunity.accessible}" id="Opportunities"/>
    <apex:relatedList list="Cases" rendered="{!$ObjectType.Case.accessible}" id="Cases"/>
    <apex:relatedList list="OpenActivities" rendered="{!$ObjectType.Task.accessible}" id="OpenActivities"/>
    <apex:relatedList list="CombinedAttachments" rendered="{!$ObjectType.NoteandAttachment.accessible}" id="NotesAndAttachment"/>
    <apex:relatedList list="ActivityHistories" rendered="{!$ObjectType.Task.accessible}" id="ActivityHistories"/>
    <!--apex:relatedList list="Account_Relationships1__r" rendered="{!($ObjectType.Account_Relationship__c.accessible && $Profile.Name == 'Master Admin')}" id="AccountRelationships" pageSize="5" -->
     
    <apex:relatedList list="Account_Owner_History__r" rendered="{!($ObjectType.Account_Owner_History__c.accessible)}" id="AccountOwnerHistory"/>
    
        <apex:relatedList list="Accounts_Management__r" rendered="{!($ObjectType.Account_Management__c.accessible)}" id="AccountManagement"/> 
    
    <apex:pageBlock title="Account History" rendered="{!$ObjectType.AccountHistory.accessible}">    
        <apex:pageBlockTable value="{!account.histories}" var="accounthistory" id="HistTable" rowClasses="odd,even" width="100%">
            <apex:facet name="footer"></apex:facet>
            <apex:column >
                <apex:facet name="header">Edit Date</apex:facet>
                <apex:facet name="footer"></apex:facet>
                <apex:outputText value="{0,date,MM/dd/yyyy HH:mm }">
                    <apex:param value="{!accounthistory.createddate}" />
                </apex:outputText>
            </apex:column>
                <apex:column >
                <apex:facet name="header">Field</apex:facet>
                <apex:facet name="footer"></apex:facet>
                <b><apex:outputText value="{!accounthistory.field}"/></b>
            </apex:column>
            <apex:column >
                <apex:facet name="header">Edited By</apex:facet>
                <apex:facet name="footer"></apex:facet>
                <apex:outputText value="{!accounthistory.createdby.name}"/>
            </apex:column>
            <apex:column >
                <apex:facet name="header">Old Value</apex:facet>
                <apex:facet name="footer"></apex:facet>
                <apex:outputText value="{!accounthistory.oldvalue}"/>
            </apex:column>
            <apex:column >
                <apex:facet name="header">New Value</apex:facet>
                <apex:facet name="footer"></apex:facet>
                <apex:outputText value="{!accounthistory.newvalue}"/>
            </apex:column>
         </apex:pageBlockTable>
     </apex:pageBlock>
    <apex:relatedList list="VOC_Survey_Response__r" rendered="{!$ObjectType.VOC_Survey_Response__c.accessible}" id="SurveyResponses"/> 
    <apex:relatedList list="Billing_Profiles__r" rendered="{!$ObjectType.Billing_Profile__c.accessible}" id="BillingProfile"/>
    <!-- DMD 3/30/2016 : BTBS-3911 Adobe eSignature for DPP contracts -->
    <apex:relatedList list="echosign_dev1__Agreements__r" rendered="{!$ObjectType.echosign_dev1__SIGN_Agreement__c.accessible}" id="Agreement" />
    <!-- The below is to register the links at the top on a related list to related list basis.
        pageId: the page id set in the apex:page tag
        relatedListId:  the id set in the apex:relatedList tag
        permission: boolean variable for access to the object.  true can be passed if guaranteed access (not recommended)
    -->    
    <c:HoverFooter pageId="acctDetail" relatedListId="Contacts" permission="{!$ObjectType.Contact.accessible}"/>
    <c:HoverFooter pageId="acctDetail" relatedListId="Addresses" permission="{!$ObjectType.Address__c.accessible}"/>
    <c:HoverFooter pageId="acctDetail" relatedListId="AccountTeamMembers" permission="{!$ObjectType.AccountTeamMember.accessible}"/>
    <c:HoverFooter pageId="acctDetail" relatedListId="Careers" permission="{!$ObjectType.Training__c.accessible}"/>
    <c:HoverFooter pageId="acctDetail" relatedListId="Opportunities" permission="{!$ObjectType.Opportunity.accessible}"/>
    <c:HoverFooter pageId="acctDetail" relatedListId="Cases" permission="{!$ObjectType.Case.accessible}"/>
    <c:HoverFooter pageId="acctDetail" relatedListId="OpenActivities" permission="{!$ObjectType.Task.accessible}"/>
    <c:HoverFooter pageId="acctDetail" relatedListId="NotesAndAttachment" permission="{!$ObjectType.NoteAndAttachment.accessible}"/>
    <c:HoverFooter pageId="acctDetail" relatedListId="ActivityHistories" permission="{!$ObjectType.Task.accessible}"/>
    <c:HoverFooter pageId="acctDetail" relatedListId="SurveyResponses" permission="{!$ObjectType.VOC_Survey_Response__c.accessible}"/>
    <c:HoverFooter pageId="acctDetail" relatedListId="AccountManagement" permission="{!$ObjectType.Account_Management__c.accessible}"/>
    <c:HoverFooter pageId="acctDetail" relatedListId="BillingProfile" permission="{!$ObjectType.Billing_Profile__c.accessible}"/>
    <c:HoverFooter pageId="acctDetail" relatedListId="Agreement" permission="{!$ObjectType.echosign_dev1__SIGN_Agreement__c.accessible}" />
</apex:page>

 
Best Answer chosen by CloudGeek
Matthew CokeMatthew Coke
The available buttons are controlled by the page layout, even if overwritten by a visualforce page. to add or remove detail page buttons, edit the corresponding page layout

All Answers

Matthew CokeMatthew Coke
The available buttons are controlled by the page layout, even if overwritten by a visualforce page. to add or remove detail page buttons, edit the corresponding page layout
This was selected as the best answer
CloudGeekCloudGeek
Thanks Mathew!
It was my bad , I was thinking like this is purely over written, but found corresponding page layout and it is done.