Display Master-Detail info in two tables

  • 1
  • Question
  • Updated 3 years ago
  • Answered
We have a master-detail relationship that we're wanting to display in two tables. Basically the idea is to have one table with the master records and when one of them is selected it displays all of the detail records related to that master in a second table. Anyone have any experience with this or done this sort of thing before? We've looked at drawers but ideally we'd like to display the info this way instead.

Photo of Matt Wyre

Matt Wyre

  • 270 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,986 Points 20k badge 2x thumb
With two tables, you could it the way that you've described with a row action on the master table, with the following steps:

  1. Activate and Set value of the named condition on your child model (the condition on the master/detail field). The value should probably be set to {{Id}}.
  2. Query the child model (standard/full).

That's it!
Just make sure your child model is set to not load any records on pageload.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,836 Points 10k badge 2x thumb
I like Matt's idea. You could also consider a queue or drawer.
Photo of David Giger

David Giger

  • 1,758 Points 1k badge 2x thumb

I think a queue would be the best way to solve this since the queue component is ideal for stuff like that.
Setup the child model as Matt Sones described it, but instead of a row action setting the condition you would have the queue "Item Action" do this.