Status check formulas

Formulas can be used for more complex status checks. For example, you could write a formula that requires a work type in the Work Type field, or that requires a specific occupancy type in the Occupancy Type field if the application is for a new construction.

Status check formulas use the oPlanApp object (an instance of the Hansen.CDR.Planning.iPlanningApplication class) to set StateCheck to either True or False. If the formula returns True, Infor Public Sector halts the planning process. If the formula returns False, Infor Public Sector doesn't halt the planning 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 application:


If oPlanApp.Address.AddressKey = 1 Then
  StateCheck = True
Else
 StateCheck = False
End If

This formula halts the planning process if an application does not have a work type recorded:


If oPlanApp.WorkType.Code.ToUpper="" Then
  StateCheck = True
Else
  StateCheck = False
End If

This formula requires a Shopping Center application to have an occupancy type:


If (oPlanApp.ApplicationType.ApplicationType.ToUpper = "SHOPPING") 
And (oPlanApp.OccupancyType.Code.ToUpper = "") Then
  StateCheck = True
Else
  StateCheck = False
End If

This formula requires a primary applicant for the application:


StateCheck = True
dim oApplicant as Hansen.CDR.Planning.IApplicant
For Each oApplicant in oPlanApp.Applicants
  If oApplicant.IsPrimaryApplicant = "True" Then
    StateCheck= False
  End If
Next oApplicant