Calculating whether to add a detail
You can use an AddOnCondition formula to calculate whether to add a detail to a case, inspection, review, or hearing. For example, you could write a formula that requires a vehicle data case detail that records the VIN, make, and model of a vehicle involved in a case; a formula that requires a hazardous materials inspection detail for a case involving unsanitary or unsafe conditions; or a formula that requires a findings hearing detail. You specify an AddOnCondition formula for a detail when you define the detail.
AddOnCondition formulas use the oCase
object (an
instance of the Hansen.CDR.CodeEnforcement.iCase
class)
to set AddOnCondition
to either True or False.
You can also use properties and methods of the detail objects in your formula. For
example, you might want to specify the detail types that the formula applies to. To
access detail properties, select the AssociatedRecordType.InspectionDetail
.
For more information, and for sample code, click the Information tab in the Formula Editor.
Examples
This formula adds a detail if the code violation was reported from a source other than the agency's call center:
AddOnCondition = False
If oCase.Source.Code.ToUpper <> "CALL" Then
AddOnCondition = True
End If
This formula adds a detail if the case is a zoning violation:
AddOnCondition = False
If oCase.CaseType.CaseType.ToUpper = "ZONING" Then
AddOnCondition = True
End If
This formula adds a detail if the case has a high priority:
AddOnCondition = False
If oCase.Priority.Code.ToUpper = "HIGH" Then
AddOnCondition = True
End If