Ash FrameworkAF
Ash Framework8mo ago
68 replies
catrapato

Counting Related Records with a Virtual Field in a Multi-Tenant app

In a multi-tenant application, when retrieving records from the database using a read action, is there a way to define a virtual field that counts the number of records in the database?

For example, something like:
calculate 
  :counter, 
  :integer, 
  expr(
    fragment(
      "SELECT COUNT(*) __TENANT_PLUS_CURRENT_TABLE__"
    )
  )
Was this page helpful?