2

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.

Thanks!!

Arnold

2 Answers 2

4

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>
</apex:repeat>

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()"/>
        </apex:tab>


        <!-- 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:pageBlockButtons>
                    <apex:pageBlockSection >
                        <apex:repeat value="{!$ObjectType.Account.FieldSets.Background}" var="backgroundfs">
                            <apex:outputfield value="{!Account[backgroundfs]}"></apex:outputfield>
                        </apex:repeat>
                    </apex:pageBlockSection>
                    <apex:inlineEditSupport event="ondblClick"
                                            showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />

                </apex:pageblock>

            </apex:form>
        <apex:tab>
    <apex:tabPanel>
<apex:page>
3
  • 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. Sep 15, 2016 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*" Sep 15, 2016 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. Sep 16, 2016 at 14:27
0

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .