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
Alister RollinsAlister Rollins 

Related list in Master-Detail relationship

Hi,

I couldn't find an answer for this.

I'm trying to extend the PersonAccount objects with a custom object called "Attendance Logs", this "Attendance Logs" object is a collection of  N "Attendance".
I want to be able to view the details of the Attendances in the PersonAccount page layout.
No matter what I've tried, I can't seem to be able to get those details on a related list at the PersonAccount level.

I've tried different combinations, the closest to work seems to be:

"Attendance" has a Master-Details relationship to "Attendance Log"
That allows "Attendance Log" to have a related list where I can view the details of each "Attendance".

"Attendance Log" is then related to an Account as Master-Details or Lookup, the related list generated only has details at the "Attendance Log" level, is not possible to view the details for each "Attendance"...

What is the setup required to display a related list 2 levels down?
e.g. PersonAccount -> Attendance Log -> Attendances
so the PersonAccount can show details for the Attendances.


If you want an example of something similar, the iContact integration is using "iContact Sent Message" and "iContact Message Statistic".

Many Thanks

Best Answer chosen by Alister Rollins
James LoghryJames Loghry
Is Attendance Logs more of a Junction object betwen the PAs and Attendance?  

Unfortunately you can't reference "grand children" relationships like you're asking.

The quick fix, and what I typically do, is create formula fields on the junction object (e.g. Attendance Logs in your case) to bring in the Attendance values that you need to display on the Attendence Log related list.

The other alternative is to develop a custom inline visualforce page, but you're asking for a lot of work going that route.

All Answers

James LoghryJames Loghry
Is Attendance Logs more of a Junction object betwen the PAs and Attendance?  

Unfortunately you can't reference "grand children" relationships like you're asking.

The quick fix, and what I typically do, is create formula fields on the junction object (e.g. Attendance Logs in your case) to bring in the Attendance values that you need to display on the Attendence Log related list.

The other alternative is to develop a custom inline visualforce page, but you're asking for a lot of work going that route.
This was selected as the best answer
Chinmay BhusariChinmay Bhusari
Hi Alister ,

 If two objects are connected via a junction object and both have master-detail relationship with the junction object then in the realted list of their junction object they can display each others data.

Hope this helps.
Regards.
Alister RollinsAlister Rollins
Thank you very much for your answers, I'm fairly new to SF so I'll look into the junction object.