You need to sign in to do that
Don't have an account?
Anupama Pandey
Apex Related List - list attribute do not support custom object
I am trying to display the list of custom object sample__c having lookup relationship with Account using standerd controller (Account) . I am unable to pull them up. i also wrote extension to pull the related samples
My controller code goes here
Error I received is
<apex:page standardController="Account" extensions="QuickyExtensionController"> <style> .activeTab {background-color: lightblue; color:white; background-image:none} .inactiveTab { background-color: lightgrey; color:black; background-image:none} </style> <apex:pageBlock title="Hello {!$User.FirstName}!" > <p>You are viewing the {!account.name} account.</p> <apex:tabPanel activeTabClass="activeTab" inactiveTabClass="inactiveTab"> <apex:tab disabled="false" label="Quicky"> <apex:relatedList list ="quickyList" > </apex:tab> </apex:tabPanel> </apex:pageBlock> </apex:page>
My controller code goes here
public class QuickyExtensionController { List<Account> quickyList { get; set;} public QuickyExtensionController(ApexPages.StandardController controller) { //populate the list on page load quickyList = [Select Quicky__c from Account where Id = : ApexPages.currentPage().getParameters().get('id')]; } }
Error I received is
Visualforce Error Help for this Page 'quickyList' is not a valid child relationship name for entity AccountQuicky has lookup relationship to Account - Please advice, If I am missing anything ! much appreciated
<apex:relatedList list ="quickyLists__r" >
Hope it helps!!
Example : As we know that there is parent-child relationship between Account and Contact and we we want to show Contact related list as displayed in Native Account page to display all associated Contact record for a Account then we have to pass the Child relation ship name in following way
You can find this name from Child Object fields by clicking on the field which link Parent Object
Please mark my answer as a best solution to your question to help others if it solves your problem.
If you want to display only related list then you dont need to write Extension.
Just correct your code with remove extension from page and use object relationship name in relatedList tag.
i.e.
Kind regards
Virendra
2. Approach two - just adding the relationship name - 'Do not work'
3. Approach three - removing controller extension and replacing quicky with Quicky__c failes even (See picture 2)
Now i am 100% sure your childrelationship name is not correct.
please check this
In this case the Child Relationship name is Line_Items.
So, I use Line_Items__r.
Check this in your object.
Kind regards
Virendra
You should use this..
<apex:relatedList list ="quickyLists__r" >