Answered
count records in a collection
How can I count the records in an unrelated entity (Meters table) that match certain criteria. Then compare the count with another fixed number. If count is greater than the fixed number it must throw a validation error. I have been playing around all day, but not working. What am I doing wrong? I dont need to create a new collection or array of values, just check the count. Thank you.
Dear Ernie,
To access to a entity that is not related to the process, you require to follow this article: http://help.bizagi.com/bpm-suite/en/index.html?access_entities_not_related_to.htm
For example:
if(<count(Request.Applicant.ApplicantMedicalTests)> == 0)
{
RequiredTest = Me.getXPath("entity-list('MedicalTest','Required = true')");
//Iterate the variable in which the Tests are stored.
for(var Counter=0; Counter < RequiredTest.size(); Counter++)
{
//Add each Test to the collection.
NewTest=Me.newCollectionItem("Request.Applicant.ApplicantMedicalTests");
NewTest.setXPath("MedicalTest",RequiredTest[Counter].getXPath("Id"));
NewTest.setXPath("Delivered",RequiredTest[Counter].getXPath("Required"));
}
To know the number of register of a non related entity, you can use: RequiredTest.size().
To send validation messages to end users, you can use this: http://help.bizagi.com/bpm-suite/en/index.html?data_validation.htm
Best Regards
Dear Ernie,
To access to a entity that is not related to the process, you require to follow this article: http://help.bizagi.com/bpm-suite/en/index.html?access_entities_not_related_to.htm
For example:
if(<count(Request.Applicant.ApplicantMedicalTests)> == 0)
{
RequiredTest = Me.getXPath("entity-list('MedicalTest','Required = true')");
//Iterate the variable in which the Tests are stored.
for(var Counter=0; Counter < RequiredTest.size(); Counter++)
{
//Add each Test to the collection.
NewTest=Me.newCollectionItem("Request.Applicant.ApplicantMedicalTests");
NewTest.setXPath("MedicalTest",RequiredTest[Counter].getXPath("Id"));
NewTest.setXPath("Delivered",RequiredTest[Counter].getXPath("Required"));
}
To know the number of register of a non related entity, you can use: RequiredTest.size().
To send validation messages to end users, you can use this: http://help.bizagi.com/bpm-suite/en/index.html?data_validation.htm
Best Regards
Comments have been locked on this page!