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 Mechanical license group to an application only if it involves HVAC or related work.
AddOnCondition formulas use the oProjectApp
object (an instance of the Hansen.CDR.Project.iProjectApplication
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 declared value recorded in the application is greater than $500,000:
AddOnCondition = False
If (oProject.DeclaredValuation > 500000) Then
AddOnCondition = True
End If
This formula adds an item if the application has a High priority and a Stop Work application status:
AddOnCondition = False
If (oProject.Priority.Code.ToUpper = "HIGH") And (oProject.ApplicationStatus.ToUpper = "STOPWORK") Then
AddOnCondition = True
End If
This formula adds an item if the application is for a new construction:
AddOnCondition = False
If (oProject.WorkType.Code.ToUpper = "NEW") Then
AddOnCondition = True
End if