Sometimes it is needed to count the number of elements in an entity. Bizagi offers a function that counts the elements in both master and parametric entities.
For parameter entities, this function numbers enabled records only.
To number the elements in an entity you can use the following function:
The following attributes are needed:
•EntityName: the entity name.
•Filter: the filter condition.
Let's suppose we need to number all the business opportunities from the Opportunities entity. The expression would be as follows:
var opportunities = CHelper.entityListCount("Opportunities","");
To number the business opportunities closed as won from a specific customer, the expression would be:
var opportunities = CHelper.entityListCount("Opportunities","Customer = '352' AND Status ='won'");