Display count of records in drawer

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I would like to show the count of the sub-records in a drawer. This will be a flag to the user that there are related records and they should open the drawer. 

I have two basic models on my page. The drawer is working properly. Just want to get this count. 

Help!
Photo of Chelsea Hirschton

Chelsea Hirschton

  • 324 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,704 Points 20k badge 2x thumb
Here's an example using Accounts and Contacts.







Additionally, you can create a rollup field on the main records for the count of records in the drawer to conditionally render the row action. ie. contactCount > 0
(Edited)
Photo of Chelsea Hirschton

Chelsea Hirschton

  • 324 Points 250 badge 2x thumb
Amazingly simple. That's great! Thanks.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,704 Points 20k badge 2x thumb
Quite  welcome.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Pat is the man!