function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ben MertonBen Merton 

Trying to create tabbed related list on custom object

I am trying to create a tabbed related list on a custom object.  The related list API name is Quality_Objective__c.  As per this post, I have changed this to Quality_Objective__r.  I have also tried Quality_Objective __c and just Quality_Objective, but it is returning an error on the page saying either:

1.  'Quality_Objective__r' is not a valid child relationship name for entity QMS
2.  'Quality_Objective__c' is not a valid child relationship name for entity QMS
3.  'Quality_Objective' is not a valid child relationship name for entity QMS

Please help!
 
<apex:page standardcontroller="QMS__c">

<apex:tabPanel >
<apex:tab label="QMS" name="QMS" id="QMS">
  <apex:relatedList subject="{!QMS__c}" list="Quality_Objective__r" />
</apex:tab>
</apex:tabPanel>


</apex:page>

 
hitesh90hitesh90
Hello Ben,

Which object is the Parent of 'Quality_Objective__c'? that object's api name should be StandardController in <apex:page> tag.

see below example:
<apex:page standardController="Account">
    <apex:pageBlock>
    You're looking at some related lists for {!account.name}:
    </apex:pageBlock>

    <apex:relatedList list="Opportunities" />

    <apex:relatedList list="Contacts">
        <apex:facet name="header">Titles can be overriden with facets</apex:facet>
    </apex:relatedList>

    <apex:relatedList list="Cases" title="Or you can keep the image, but change the text" />
</apex:page>

Thank You,
Hitesh Patel
Email :- hiteshpatel.aspl@gmail.com
http://mrjavascript.blogspot.in/
AnjithKumarAnjithKumar
Hello Ben,

If the QMS__C is master and  Quality_Objective__c child then check child relationship name on the field . I am thinking your object child object relationship name is "Quality_Objectives" Quality_Objective
User-added image

if it is Quality_Objectives is chilld relationship name then you should use following code.
<apex:page standardcontroller="QMS__c">
	<apex:tabPanel >
		<apex:tab label="QMS" name="QMS" id="QMS">
			<apex:relatedList subject="{!QMS__c}" list="Quality_Objectives__r" />
		</apex:tab>
	</apex:tabPanel>
</apex:page>


let me know if it helps you.

Thanks,
Anjith kumar