Calculating whether to add a detail

You can use an AddOnCondition formula to calculate whether to add a detail to a license, inspection, or review. For example, you could write a formula that requires a certification license detail for any general contractor license, or a formula that requires information uncovered from a background check review.

AddOnCondition formulas use the oTradeLicense object (an instance of the Hansen.CDR.TradeLicense.iTradeLicense 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 LicenseDetail, InspectionDetail, or ReviewDetail node under TradeLicenseSignature 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 license is in the General license category:


AddOnCondition = False
If oTradeLicense.LicenseCategory.Code.ToUpper = "GEN" Then
  AddOnCondition = True
End If

This formula adds a detail if there is nothing recorded for the license's location:


AddOnCondition = False
If oTradeLicense.Location="" Then
  AddOnCondition = True
End If

This formula adds a detail if there are any employees associated with the license:


AddOnCondition = False
If oTradeLicense.LicenseEmployees.Count > 0 Then
  AddOnCondition = True
End If