Calculating whether to add an inspection

You can use an AddOnCondition formula to calculate whether an inspection is added to an application. For example, you could write a formula that requires a safety inspection for any special event that involves power equipment.

AddOnCondition formulas use the oUseApp object (an instance of the Hansen.CDR.Use.iUseApplication 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 Inspection node under UseSignature in the Methods and Properties tree. You must also use the AssociatedRecordType 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 application is for a storage facility:


AddOnCondition = False
If (oUseApp.OccupancyType.Code.ToUpper = "STORAGE") Then
  AddOnCondition = True
End If

This formula adds an inspection if the application is for a new construction:


AddOnCondition = False
If (oUseApp.WorkType.Code.ToUpper = "NEW") Then
  AddOnCondition = True
End if