Can I show Number of Rows in Model in the Tab Name?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
Also, any clues on showing a Count of rows in a model?

Note: This topic was created from a reply on the Field in Tab Name topic.
Photo of Jacob Flatter

Jacob Flatter

  • 1,512 Points 1k badge 2x thumb

Posted 5 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
As has been mentioned in other forum posts - the Tab Name property can take merge data.  But one lesser-documented-aspect of our merge syntax is that it can show model length as well.   

Use the syntax:  {{$Model.ModelName.data.length}}  to show a number of rows for the model.  We've done that on the case detail page to show the number of comments on the case in the comments tab.

 
Photo of Jeff Rutter

Jeff Rutter

  • 1,162 Points 1k badge 2x thumb
Rob, this is a really cool feature, but wondering if it is possible to take it a step further.

One thing I've noticed is that if you have the tab set on a detail page the number like you show above works, but if in the data in that tab changes say you add another case in-line for an Account it doesn't update the number in the tab and I thought trying to requery the model would help, but no luck.

I also tried to set a roll-up summary field on the detail page object (E.G. Account) and when the model is requeried the field is updated and incremented, but when it is in the merge syntax within the tabset it doesn't get reflected unless you reload the page. Is this expected behavior?

Thanks!

Jeff Rutter