Calculating whether to add a detail

You can use an AddOnCondition formula to calculate whether to add a detail to an application, inspection, or review. For example, you could write a formula that requires information about whether stalls or kiosks will be set up during a special event; a formula that requires an elevator inspection detail that records the make and model of that elevator; or a formula that requires a traffic impact review detail that records the findings of such a review.

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 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 ApplicationDetail, InspectionDetail, or ReviewDetail node under UseSignature in the Methods and Properties tree. You must also use the AssociatedRecordType node to indicate the type of record, such as 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 declared value recorded in the application is greater than $200,000:


AddOnCondition = False
If (oUseApp.DeclaredValuation > 200000) Then
  AddOnCondition = True
End If

This formula adds a detail if the application is for an industrial facility:


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

This formula adds a detail if the application is for a remodel:


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