Calculating whether to add an inspection
You can use an AddOnCondition formula to calculate whether an inspection is added to a case. For example, you could write a formula that requires an inspection to verify that a vehicle has been abandoned. You specify an AddOnCondition formula when you define an inspection type.
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 Inspection
object in your
formula. For example, you might want to specify the inspection types that the formula
applies to. To access inspection properties, select the node under in the tree. You must also use the node to indicate the type of record
(AssociatedRecordType.Inspection
).
For more information, and for sample code, click the Information tab in the Formula Editor.
Examples
This formula adds an inspection if the case belongs to the Eastbay case group:
AddOnCondition = False
If oCase.CaseGroup.Code.ToUpper = "EASTBAY" Then
AddOnCondition = True
End If
This formula adds an inspection if the case has a high priority:
AddOnCondition = False
If oCase.Priority.Code.ToUpper = "HIGH" Then
AddOnCondition = True
End If