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 adds a detail to a license for information about the home-owner's association that governs the residence for a home-based business; a formula that adds detail for specific information about a health code violation for an inspection; or a formula that adds a detail describing a variance for a review.
AddOnCondition formulas use the oLicenseApp
object (an instance of the Hansen.CDR.BusinessLicense.iLicenseApplication
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 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 for a partnership. The
formula uses the enumeration value from the LicenseBusinessType
enumeration instead of the business type name. If
you have the correct access rights, you can view this enumeration using the Schema
Manager.
AddOnCondition = False
If oLicenseApp.TypeOfBusiness = 4 Then
AddOnCondition = True
End If
This formula adds a detail if the name of the business is different from the its doing-business-as name:
AddOnCondition = False
If (oLicenseApp.BusinessName.ToUpper) <> (oLicenseApp.DBAName.ToUpper) Then
AddOnCondition = True
End If
This formula adds a detail if there is nothing recorded for the license's location:
AddOnCondition = False
If oLicenseApp.Location="" Then
AddOnCondition = True
End If