starting point for master details objects

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Hi,
I have a custom object which has master details relationship with Accounts.
I would like to know if I want to create a filtered report so pull out the eligible accounts based on the relevant filters on  the child object where should be my starting point?
Do I need to start with the Account object or the custom object.
Thanks,
Photo of Ramtin Sohrabian

Ramtin Sohrabian

  • 220 Points 100 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
If you want to show the rows in your child object filtered by some attribute of thier parent (accounts) -- I'd reccomend making your model on the child object.  The condition builder can go through the relationship field to the parent object and select any field there. 

This will also work if you are trying to do aggregations of that child object data. 
Photo of Ramtin Sohrabian

Ramtin Sohrabian

  • 220 Points 100 badge 2x thumb
Hi Rob,
Thank you for your reply I really appreciate it.
What if I want to display data from both parent and child objects? Do you think I should start with parent?
Thanks
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
So.  If you want a list of children - with parent data shown on every line (even if the parent value is repeated),  Start with the child. 

Child 1 -   Parent Value 1
Child 2 - Parent Value 1
Child 3 - Parent Value 2

But if you want to show unique child values by parent (so you only see each parent value once)  start on the parent and then include the children as "child records".  This will give you a table row for each parent value. 

Parent Value 1   -   Child 1
Child 2
Parent Value 2 - Child 3