Calculating whether to add a license fee

You can use an AddOnCondition formula to calculate whether a fee is added to a license. For example, you could write a formula that applies different fees to licenses for different types of golf courses, such as miniature, nine-hole, or 18-hole.

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 Fee object in your formula. For example, you might want to specify the fee types that the formula applies to. To access fee properties, select the Fee node under LicenseSignature in the Methods and Properties tree. You must also use the AssociatedRecordType node to indicate the type of record (AssociatedRecordType.Fee).

For more information, and for sample code, click the Information tab in the Formula Editor.

Examples

This formula adds a fee if the license is for an LLC or a corporation. The formula uses the enumeration value from the LicenseBusinessType enumeration instead of the business type names. If you have the correct access rights, you can view this enumeration using the Schema Manager.


AddOnCondition = False
If oLicenseApp.TypeOfBusiness = 3 Or oLicenseApp.TypeOfBusiness = 2 Then
  AddOnCondition = True
End If

This formula always adds a fee unless the license is in the Auto license category:


AddOnCondition = True
If oLicenseApp.LicenseCategory.Code.ToUpper = "AUTO" Then
  AddOnCondition = False
End If

This formula adds a fee if there are any endorsements associated with the license:


AddOnCondition = False
If oLicenseApp.Endorsements.Count > 0 Then
  AddOnCondition = True
End If