Calculating whether to add a condition

You can use an AddOnCondition formula to calculate whether a condition is added to a case. For example, you could write a formula that requires a primary contact. You specify an AddOnCondition formula when you define a condition 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 Condition object in your formula. For example, you might want to specify the condition types that the formula applies to. To access condition properties, select the Condition node under CodeEnforcementSignature in the Methods and Properties tree. You must also use the AssociatedRecordType node to indicate the type of record (AssociatedRecordType.Condition).

For more information, and for sample code, click the Information tab in the Formula Editor.

Examples

This formula adds a condition if the code violation was reported to an agency's call center:

AddOnCondition = False
If oCase.Source.Code.ToUpper = "CALL" Then
  AddOnCondition = True
End If

This formula adds a condition if the case is a nuisance violation:

AddOnCondition = False
If oCase.CaseType.CaseType.ToUpper = "NUISANCE" Then
  AddOnCondition = True
End If

This formula adds a condition if the case has a priority other than low:

AddOnCondition = False
If oCase.Priority.Code.ToUpper <> "LOW" Then
  AddOnCondition = True
End If