+ Start a Discussion
adi salesforceadi salesforce 

create a tab panel of accounts,contacts,opportunities ,cases when I open account tab the corresponding account home page has to come

HARSHIL U PARIKHHARSHIL U PARIKH
Hi Adi Salesforce,

I would recommend following code for a Visualforce page. I have simply used a standard controller and some of the OOB visualforce tags to do the job. Here we go:
 
<apex:page standardController="Account">
    <apex:pageBlock >
        <apex:tabPanel switchType="ajax">
            <apex:tab label="Account Details">
                <apex:detail relatedList="FALSE"/>
            </apex:tab>
            
            <apex:tab label="Contact">
                <apex:relatedList list="Contacts"/>
            </apex:tab>
            
            <apex:tab label="Opportunities">
                <apex:relatedList list="Opportunities"/>
            </apex:tab>
            
            <apex:tab label="Cases">
                <apex:relatedList list="Cases"/>
            </apex:tab>
        </apex:tabPanel>
    </apex:pageBlock>
</apex:page>

Here is how it would look like once you override standard page with a visualforce page. Or you can passin an Id inside the parameter. E.g., goto any account record and copy the ID from URL now goto your Visualforce page and pass the parameter by typing ?Id=056465305fdfddf at the end of an URL. 

Below is what your output would look like,

User-added image

Now, once you click on Contact tab it will show all contacts related to that account and same thing goes for Opportunities and Cases,

User-added image

Adi, if this solves the puzzle then please mark this answer as a best answer!