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
sushmaiyer2@gmail.comsushmaiyer2@gmail.com 

How to change the Tab Style of Standard Object using Vistualforce page?


Hi All,

I have a requirement to change the Tab colour of Accounts Tab to Orange,so that All the Section Names in Accounts will have Orange Colour and also the Related list names should have orange border instead of the Standard blue in "Account Detail page".

Wht i have Coded till now :-

<apex:page standardController="Account" tabstyle="Territory__c">

<apex:detail relatedList="true" title="true"/>

</apex:page>


In the above Code Territory__c is my Custom object having Orange colour tabsyle i took reference from this link :-

http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_std_styling.htm

But its not working and bydefault Territory Tab is getting selected insted of accounts....:(

Best Answer chosen by Admin (Salesforce Developers) 
sushmaiyer2@gmail.comsushmaiyer2@gmail.com

Create a Visualforce page with the below code(same as yours but without a tabStyle for now).

<apex:page standardController="Account">
    <apex:detail relatedList="true" title="true"/>
</apex:page>


Then, go to Your Name | Setup Create Tabs. Under the Visualforce Tabs click New and name it as say Accounts and then select the Visualforce Page that we just created as the Content. Opt the style as say Orange CRT TV for the Orange color but do not add VF Accounts Tab to your header(where all tabs are there).

Now, back to the Visualforce page amend the code as below(notice the new tabStyle):

<apex:page standardController="Account" tabStyle="Accounts__tab">
    <apex:detail relatedList="true" title="true"/>
</apex:page>


Finally we have to override the View of the Standard Accounts object.  Go to Your Name | Setup Cutomize Buttons & Links. Under the Standard Buttons & Links, click Edit close to the View action. Select Override With with Visualforce Page and then select our Visualforce page from that list. Click Save.

 

 

Got this Solution from Customer Community from Deepak K Anand...

All Answers

bob_buzzardbob_buzzard

It is working exactly as the doc you have linked to describes.  Their example is:

 

--- snip ---

 

the following page uses the Account standard controller, but renders a page that highlights the Opportunities tab and uses the Opportunity tab's yellow coloring:

 

--- snip ---

 

So that is what you are seeing - you are using the account standard controller, but have rendered a page that highlights the Territory tab.

sushmaiyer2@gmail.comsushmaiyer2@gmail.com

Create a Visualforce page with the below code(same as yours but without a tabStyle for now).

<apex:page standardController="Account">
    <apex:detail relatedList="true" title="true"/>
</apex:page>


Then, go to Your Name | Setup Create Tabs. Under the Visualforce Tabs click New and name it as say Accounts and then select the Visualforce Page that we just created as the Content. Opt the style as say Orange CRT TV for the Orange color but do not add VF Accounts Tab to your header(where all tabs are there).

Now, back to the Visualforce page amend the code as below(notice the new tabStyle):

<apex:page standardController="Account" tabStyle="Accounts__tab">
    <apex:detail relatedList="true" title="true"/>
</apex:page>


Finally we have to override the View of the Standard Accounts object.  Go to Your Name | Setup Cutomize Buttons & Links. Under the Standard Buttons & Links, click Edit close to the View action. Select Override With with Visualforce Page and then select our Visualforce page from that list. Click Save.

 

 

Got this Solution from Customer Community from Deepak K Anand...

This was selected as the best answer
Rajat Singhal 5Rajat Singhal 5
This is not Work on Quote .i.e. when we try to Create PDF of a Quote.