Calculating whether to charge the maximum inspection fee

You can direct Infor Public Sector to calculate whether a maximum inspection fee is added to a case using a maximum inspection condition formula. A maximum inspection fee is a fee that is charged for reinspections. For example, you could write a formula that adds a maximum inspection fee if a case has more than two Compliance reinspections. You specify a maximum inspection condition formula for an inspection type when you define an inspection type.

Maximum inspection condition formulas use the oCase object (an instance of the Hansen.CDR.CodeEnforcement.iCase class) to set AddMaxFee to either True or False. If the formula returns True, Infor Public Sector adds the maximum inspection fee to the case. If the formula returns False, Infor Public Sector doesn't add the fee. For more information about this object and for sample code, click the Information tab in the Formula Editor.

Examples

This formula adds the maximum fee to a case if a compliance inspection has been conducted more than two times.


dim oInsp as Hansen.CDR.CodeEnforcement.IInspection
dim lCounter as Integer = 0

For Each oInsp in oCase.Inspections
   If oInsp.InspectionType.Code.toUpper = "COMPLY" Then
     lCounter += 1
   End If
next oInsp

If lCounter > 2 then
  AddMaxFee = True
Else
   AddMaxFee = False
End If

This formula adds the maximum fee to a case if a maintenance inspection has been conducted more than three times.


dim oInsp as Hansen.CDR.CodeEnforcement.IInspection
dim lCounter as Integer = 0

For Each oInsp in oCase.Inspections
   If oInsp.InspectionType.Code.toUpper = "MAINTAIN" Then
     lCounter += 1
   End If
next oInsp

If lCounter > 3 then
  AddMaxFee = True
Else
   AddMaxFee = False
End If