Calculating whether to add a condition

You can use an AddOnCondition formula to calculate whether a condition is added to a license. For example, you could write a formula that requires the applicant submit the results of a skills examination to qualify for a license.

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

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

Examples

This formula adds a condition 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 condition if there is nothing recorded for the license's location:


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

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


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