Calculating the status of a planning condition

You can use an auto status formula to automatically set the status of a planning condition. For example, you could write a formula that changes the status of a planning condition that requires all child applications to have a declared valuation from Unchanged to Met only if a declared valuation is recorded for each building application.

Auto status formulas use the oBldgApp object, the oPlanApp object, or the oProjectApp object (an instance of the Hansen.CDR.Building.iBuildingApplication class, an instance of the Hansen.CDR.Planning.iPlanningApplication class, or an instance of the Hansen.CDR.Project.iProjectApplication class) to set StatusCode to a string value that is the exact name of the status that should be assigned to the planning condition. For more information about this object and for sample code, click the Information tab in the Formula Editor. The auto status formula bypasses the status order established by your agency and sets the status according to the results of the formula.

Example

This formula defaults the status to Active or sets the status to Deferred if the planning application is for the West Side subdivision.


StatusCode = "Active"
If oPlanApp.SubDivision.Code.ToUpper = "WESTSIDE" Then
  StatusCode = "Deferred"
End If

This formula defaults the status to Active or sets the status to Met if the total unpaid fees on a building application is zero or less.


StatusCode = "Active"
If oBldgApp.Application.TotalUnpaidFees <= 0 Then
  StatusCode = "Met"
End If

This formula defaults the status to Deferred or sets the status to Active if the project application is for an educational facility.


StatusCode = "Deferred"
If oProjApp.OccupancyType.Code.ToUpper = "EDUCATION" Then
  StatusCode = "Active"
End If