Calculating whether to add a license group

You can use an AddOnCondition formula to calculate whether a license requirement is added to an application. For example, you could write a formula that adds an Electrical license group to an application only if it involves electrical work. You specify an AddOnCondition formula when you define or edit a license group.

AddOnCondition formulas use the oBuildingApp object (an instance of the Hansen.CDR.Building.iBuildingApplication class) to set AddOnCondition to either True or False. For more information, and for sample code, click the Information tab in the Formula Editor.

Examples

This formula adds an item if the application is for a commercial building:


AddOnCondition = False
If (oBldgApp.OccupancyType.Code.ToUpper = "COMMERCIAL") Then
  AddOnCondition = True
End If

This formula adds an item if the application is for a new construction:


AddOnCondition = False
If (oBldgApp.WorkType.Code.ToUpper = "NEW") Then
  AddOnCondition = True
End if