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.

AddOnCondition formulas use the oUseApp object (an instance of the Hansen.CDR.Use.iUseApplication 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 (oUseApp.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 (oUseApp.WorkType.Code.ToUpper = "NEW") Then
  AddOnCondition = True
End if