Calculating a count activation rule

You can direct Infor Public Sector to calculate the criteria that will halt an application process at the milestone indicated in a Count activation rule using a count formula. For example, you could write a formula for an activation rule for a planning condition that requires that a park must have been finalized prior to the issuance of the twentieth building application for a subdivision project. You specify a count formula when you define a count activation rule for a planning condition. Note that you must select a CDR product from the Community Development Application Type list before you can access the Formula popup.

Count formulas use the oPlanCond object (an instance of the Hansen.CDR.Planning.IPlanningCondition class) to set CountCheck to a Boolean value. If the formula returns True, Infor Public Sector halts the application at the milestone indicated in the activation rule. If the formula returns False, the application process is not affected. For more information about this object and for sample code, click the Information tab in the Formula Editor.

Examples

This formula halts the planning process if a planning application is not associated with more than three SubDiv project applications that are at the Pre-Complete milestone.


CountCheck = True

Dim oProjectCount As Hansen.CDR.Planning.IPlanningProjectApplication
Dim oProjCounter As Integer
oProjCounter = 0

For Each oProjectCount in oPlanCond.PlanningApplication.AssociatedProjectApplications
  If oProjectCount.ProjectApplication.ApplicationType.ApplicationType = "SubDiv" AND oProjectCount.ProjectApplication.ProcessState.Code="Pre-Complete" Then
    oProjCounter += 1
  End If
Next oProjectCount 

If oProjCounter > 3 Then
  CountCheck = False
End If

This formula halts the permitting process if a project application is not associated with more than 14 SFD building applications that are at the Pre-COO milestone.


CountCheck = True

Dim oBuildingCount As Hansen.CDR.Project.IProjectBuildingApplication
Dim oBuildCounter As Integer
oBuildCounter = 0

For Each oBuildingCount in oPlanCond.ProjectApplication.AssociatedBuildingApplications
  If oBuildingCount.BuildingApplication.ApplicationType.ApplicationType = "SFD" AND oBuildingCount.BuildingApplication.ProcessState.Code="Pre-COO" Then
    oBuildCounter += 1
  End If
Next oBuildingCount

If oBuildCounter > 14 Then
  CountCheck = False
End If

This formula halts the permitting process if a building application does not have at least one child Electrical building applications that are at the Completed milestone.


CountCheck = True

Dim oBuildingCount As Hansen.CDR.Building.IParentChildRelationship
Dim oBuildCounter As Integer
oBuildCounter = 0

For Each oBuildingCount in oPlanCond.BuildingApplication.ChildrenRelationships
  If oBuildingCount.ChildApplication.ApplicationType.ApplicationType = "Electrical" AND oBuildingCount.ChildApplication.ProcessState.Code = "Completed" Then
    oBuildCounter += 1
  End If
Next oBuildingCount

If oBuildCounter > 1 Then
  CountCheck = False
End If