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
King KooKing Koo 

How to display the parent's child B's related list from child A page layout?

Hi there

I have a parent object (such as Applicant).

There are several related lists regarding the Applicant.  Such as Application History, Training History, Employment History, Education History, etc.  Applicant is the master and these 4 other things are the children to the Applicant custom object.

The use case is that when the client is looking at an applicant's application (there can be many applications, but let's say the client is viewing one of those applications, and the client wants to see the applicant's training history.

The client would like to have a custom link on the application record that says "Training History", and when clicked, a window will pop up that will display the applicant's training history.

At first I thought I would simply have a VF page that shows the training history of the applicant via <apex:relatedList>, and the page would use the applicant object as the standard controller.  I thought that would be really easy!

<apex:page standardController="Applicant__c">
  <apex:relatedList list="TrainingHistories__r"/>
</apex:page>

But then because I'm using the standard controller of the Applicant object, I will not be able to create it as a custom link on an "Application" page layout.

So at the end I have to use a custom controller instead and use the ApexPages.getParameters() to pass the ID of the applicant.

I am able to do that, but then I wonder is there really no way to implement this requirement without Apex?

I was trying to think of another method.  Is it possible for me to display the Training History related list of an applicant in the applicant's Application view?

Which is the title of my post, how do I display a parent's child's related list from the parent's another child's page layout?

Thanks
king


Sonam_SFDCSonam_SFDC
Hi King,

Is there a chance we can have a relationship between Application and Training object since they are both linked to a single applicant?
Reason I asked is because when I read the requirement, it appears as if the Application is linked to trainings displayed in the related list - and if there is a relationship - getting the related list won't be a problem as you already know. 
MeighanSFMeighanSF
Did you ever get an answer for this?  I am currently trying to show on a Child Obj A the Parent (one to many relationship parent to child) and Child Object B of the parent(also one to many relationship parent to child) and I am having difficulty.  My two children are ONLY related via the parent.