Our Account Page layout is getting out of hand. The "Long Scroll" is not a great user experience. We've implemented a child object containing 75 fields, but all the object's data has a 1:1 relationship to Account. The child exists solely to put the fields on another layout. It's causing a lot of work as we want the data to flow to Contacts. Rather than write Triggers & Process Builders to push the data around, I'd like to move all the fields up to the Account object, remove the custom object and create a tabbed view of Accounts via Visualforce.

enter image description here

All examples I find use a separate tab for the related lists but have all account fields on the same tab. I want to add a tab "Client Account Details" and put the 75 pertinent fields only on that VF tab keeping the bulk of our fields on the standard Acct Page Layout.

Soooo.....possible? Has anybody done this?Any examples you could point to would be most helpful.




One way you can do it is to use FieldSets. You create a field set for each tab and inside the override page, use a repeat to render them. Like so:

<apex:repeat value="{!$ObjectType.Account.FieldSets.Background}" var="backgroundfs">
    <apex:outputfield value="{!Account[backgroundfs]}"></apex:outputfield>

Here is a page that uses the above, for reference:

<apex:page standardController="Account" showHeader="true" tabStyle="account"  >

    <social:profileViewer entityId="{!Account.id}" /> 

    <apex:detail relatedList="true" title="true" inlineEdit="true" oncomplete="location.reload()"/>
    <apex:tabPanel switchType="client" selectedTab="tabdetails" id="AccountTabPanel"  >

        <!-- DETAILS TAB -->          
        <apex:tab label="Details" name="AccDetails" id="tabdetails" >
            <apex:detail relatedList="false" title="false" inlineEdit="true" oncomplete="location.reload()"/>

        <!-- ABOUT TAB -->  
        <apex:tab label="About" name="About" id="About">
            <apex:form >
                <apex:pageblock id="Background" title="Background">
                    <apex:pageBlockButtons location="top">
                        <apex:commandButton value="Save" action="{!save}"/>
                        <apex:commandButton value="Cancel" action="{!cancel}"/>
                    <apex:pageBlockSection >
                        <apex:repeat value="{!$ObjectType.Account.FieldSets.Background}" var="backgroundfs">
                            <apex:outputfield value="{!Account[backgroundfs]}"></apex:outputfield>
                    <apex:inlineEditSupport event="ondblClick"
                                            showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />


  • Thanks so much I've just started hacking on this. Do you know if I could create a specific Account Page Layout for my subset of client fields and just call that particular Account page layout from the VF page which is inserted into the VF tab? That would allow Admins to more easily make adjustments to the way the page presents. – Arnold Brown Sep 15 '16 at 2:30
  • Not sure I understand... what's the structure? Definitely, given this solution, you can't really add blank spaces, unfortunately. You could define a few "dummy" text fields and render a blank space if you see a field starting with "dummy*" – Caspar Harmer Sep 15 '16 at 3:19
  • Blank space via blank text fields.... that's a good idea thank you! The "Create Normal Account Layout and Assign to VF Tab" idea, if possible would ease the code maintenance burden. If that were doable, when fields displayed in that tab needed to change with changing org needs, the admins could edit the specific layout that would only contain that subset of fields and that would change the user interface absent editing the actual VF markup. – Arnold Brown Sep 16 '16 at 14:27

One way to achieve this would be to create vf page tab and then link standard controller to this vf page...

section divider can be used for adding blank spaces.

  • This answer would be much better with example code for the VF page tab – Dave Humm Oct 13 '16 at 12:14

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.