Is it possible to get the current record when using sub-navigation for the badge?

I'm trying to count the related items for the parent record so I can show a navigation badge when using sub-navigation.

Is it possible to get the current record somehow considering this is a static method?
Was this page helpful?