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
WesGrayWesGray 

VF Page under custom object's tab

I'm sure there is a simple answer but I haven't been able to find it yet.  I have a custom object Employee which I have made a tab on my app.  I have a custom controller for the object, so in the VF page I have <apex:page Controller="EmployeeController">.  I want my VF page to display under the Employee tab and instead it displays under the Home tab.  How can I fix this?
Ron HessRon Hess
Set the attribute on apex page: tabStyle

The Salesforce object that controls the color, styling, and selected tab for this page. This attribute must be specified with the developer name for the object. For example, to use the styling associated with MyCustomObject, use tabStyle="MyCustomObject__c". If not specified, this value defaults to the style of the associated controller (if a standard controller), or the Home tab (if a custom controller).
WesGrayWesGray
Great, that solves that problem, thanks!  It does lead me to a followup question: Is their a way to set a Visual Force page to use the tabstyle of Visual Force Tab, i.e. a tab which has no associated object.  tabStyle="VFPageName" doesn't seem to work.
Ron HessRon Hess
No, you would have to use a custom object , then override the home page for that object with the visualforce page, then you could use that object name in the tabStyle

you would be using up a custom object just to get the color, not very elegant.
lopezclopezc
hi!

I have a VF page that I would like to display it under the Client Accounts tap (I am overwritting this tap) this is my code, but it is not working (the client accounts tap is never replace with my VF page)

Code:
<apex:page controller="dataListCon" tabStyle="Contact" showheader="true">

<apex:sectionHeader title="Client Accounts" subtitle="Home" help="javascript:openPopupFocusEscapePounds('/help/doc/user_ed.jsp—loc=help&target=contacts_overview.htm&section=Contacts&showSplash=true', 'Help', 700, 600, 'width=700,height=600,resizable=yes,toolbar=yes,status=no,scrollbars=yes,menubar=yes,directories=no,location=no,dependant=no', false, false);" />
<apex:form >
View: 
<apex:selectList id="chooseColor" size="1">
 </apex:selectList> 
<apex:commandButton action="{!Go}" value="Go!"/>
</apex:form>
 <apex:form >
<apex:pageBlock title="Recent Client Accounts">
    <apex:pageBlockTable value="{!contacts}" var="contact" cellPadding="4" border="0" rowClasses="dataRow" headerClass="headerRow"  footerClass="pShowMore">
        <apex:column width="500px">
                    <apex:facet name="header">Name</apex:facet>
                    <apex:outputLink value="https://cs2.salesforce.com/{!contact.id}" id="theLink">
                           <apex:outputText value="{!contact.lastname}"/>
                   </apex:outputLink>
        </apex:column>
        <apex:column width="400px">
                  <apex:facet name="header">Account</apex:facet>
                  <apex:outputLink value="/{!contact.AccountId}" >
                           <apex:outputText value="{!contact.account.name}"/>
                   </apex:outputLink>           
        </apex:column>
        <apex:column width="400px">
                  <apex:facet name="header">Phone</apex:facet>
                         {!contact.phone}
        </apex:column>
       <apex:facet name="footer">
            <apex:commandLink action="{!lookMore}" value="Show 10 items" id="theCommandLink"/>            
        </apex:facet>
    </apex:pageBlockTable>
</apex:pageBlock>       
   </apex:form>

Do you know what I am doing wrong?

Do you know any other way to overwrite this Client Accounts tap? Rebuild it from the beginning seems to be a very hard work