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 fireplace inspection for any new, single-family dwelling that includes a fireplace. You specify an AddOnCondition when you define an inspection type.

AddOnCondition formulas use the oBuildingApp object (an instance of the Hansen.CDR.Building.iBuildingApplication 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 BuildingSignature 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 (oBldgApp.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 (oBldgApp.WorkType.Code.ToUpper = "NEW") Then
  AddOnCondition = True
End if