Count the number of objects in my entity

0
Is there a way to get the count of the number of objects in my entity? I know I can retrieve them then use the count function on the list, however I know the entity has 200k+ items and I'll most likely get a runtime error trying to store that in memory. 
asked
3 answers
4

If you add the count aggregation right after the retrieve activity, the runtime will execute an optimized SQL query using the COUNT function. It should work just fine even with 200k records.

answered
1

Hello Remington Bassett,

If you don't want to use MF and list aggregate count function.

You can create one helper entity where you will store the record total count of the entity and create one After commit event handler on base entity to update the count of that helper entity.

You can show this Helper entity count on your page.

answered
-1

Hi Remington Bassett,

 

You can use Mendix OQL to get the count of objects in your entity. Download the OQL module from the Marketplace, and in your microflow, use the Execute OQL Statement (Count Rows) activity. It will return the count of all objects without loading them into memory.

Thanks

answered