You need to sign in to do that
Don't have an account?
standard controller VF page returns only 2 related list items
I have a standard Account controller VF page, and reference the contacts related list in a pageblock table.
I have a button on the standard layout to display the page, and it should show all of the contacts, but it doesn't, it only shows the first 2 retrieved. I tried this with Opportunities as well, and have the same result.
Any ideas?
Here is a code sample:
<apex:page standardController="Account" tabStyle="Account" sidebar="false" showHeader="false"> <apex:form > <apex:pageBlock title="Account Summary"> <apex:pageMessages /> <apex:pageBlockButtons location="top"> <input type="button" value="Print Screen" onClick = "window.print()"> </input> </apex:pageBlockButtons> <apex:pageBlockSection title="Account Detail" collapsible="true"> <apex:outputField value="{!Account.Name}"/> <apex:outputField value="{!Account.Geography_Account__c}"/> <apex:outputField value="{!Account.Phone}"/> <apex:outputField value="{!Account.SalesRegionAcct__c}"/> <apex:outputField value="{!Account.Website}"/> <apex:outputField value="{!Account.Fortune_500__c}"/> <apex:outputField value="{!Account.TickerSymbol}"/> <apex:outputField value="{!Account.AnnualRevenue}"/> </apex:pageBlockSection> <apex:pageBlockSection title="Account Profile" columns="1" collapsible="true"> <apex:outputField value="{!Account.Company_Overview__c}"/> <apex:outputField value="{!Account.Company_Offerings__c}"/> <apex:outputField value="{!Account.Key_Business_Applications__c}"/> <apex:outputField value="{!Account.Competitors_Software_Installed__c}"/> </apex:pageBlockSection> </apex:pageBlock> <apex:pageBlock title="Action Plans"> <apex:pageBlockTable value="{!Account.Action_Plans__r}" var="actplan"> <apex:column value="{!actplan.Name}"/> <apex:column value="{!actplan.Responsible__c}"/> <apex:column value="{!actplan.Target_Date__c}"/> <apex:column value="{!actplan.Completed_Date__c}"/> <apex:column value="{!actplan.Comments__c}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Assets"> <apex:pageBlockTable value="{!Account.Assets}" var="asts"> <apex:column value="{!asts.Name}"/> <apex:column value="{!asts.Market__c}"/> <apex:column value="{!asts.Product_Family__c}"/> <apex:column value="{!asts.Maintenance_Date__c}"/> <apex:column value="{!asts.Maintenance_Status__c}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Contacts"> <apex:pageBlockTable value="{!Account.Contacts}" var="cont"> <apex:column value="{!cont.Name}"/> <apex:column value="{!cont.Active__c}"/> <apex:column value="{!cont.Title}"/> <apex:column value="{!cont.Email}"/> <apex:column value="{!cont.Phone}"/> <apex:column value="{!cont.Comments__c}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Opportunities"> <apex:pageBlockTable value="{!Account.Opportunities}" var="opps"> <apex:column value="{!opps.Name}"/> <apex:column value="{!opps.Type}"/> <apex:column value="{!opps.StageName}"/> <apex:column value="{!opps.Amount}"/> <apex:column value="{!opps.CloseDate}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
Hi,
Out of curiosity I have just tested your code it is working fine.......
Might be you have only 2 contacts for that account which you are passing the Id
Thanks for the response. That was the first thing I checked. My test account has 18 contacts and 11 opportunities, but only the first 2 of each are showing up. Very odd.