Status check formulas
Formulas can be used for more complex status checks. For example, you could write a formula that requires a specific occupancy type in an Occupancy Type field if the application is for industrial construction.
Status check formulas use the oProjectApp
object (an instance of the Hansen.CDR.Project.iProjectApplication
class) to set StateCheck
to either True or False. If the formula
returns True, Infor Public Sector halts the permitting process. If the formula returns False, Infor Public Sector
doesn't halt the permitting process. For more information about this object and for
sample code, click the Information tab in the Formula Editor.
Examples
This formula requires an address for the project's primary location:
If oProjectApp.Address.AddressKey = 1 Then
StateCheck = True
Else
StateCheck = False
End If
This formula halts the permitting process if an application does not have a work type recorded:
If oProjectApp.WorkType.Code.ToUpper="" Then
StateCheck = True
Else
StateCheck = False
End If
This formula requires any application involving an educational facility to have at least four copies of project plans filed:
If (oProjectApp.OccupancyType.Code.ToUpper = "EDUCATIONAL")
And (oProjectApp.NumberOfProjects < 4) Then
StateCheck = True
Else
StateCheck = False
End If
This formula requires a primary applicant for the application:
StateCheck = True
dim oApplicant as Hansen.CDR.Project.IApplicant
For Each oApplicant in oProjectApp.Applicants
If oApplicant.IsPrimaryApplicant = "True" Then
StateCheck= False
End If
Next oApplicant