Calculating whether to add a condition
You can use an AddOnCondition formula to calculate whether a condition is added to an application. For example, you could write a formula that requires both a declared value and square footage for any work involving an educational institution. You specify an AddOnCondition formula when you define a condition type.
AddOnCondition formulas use the oBuildingApp
object (an instance of the Hansen.CDR.Building.iBuildingApplication
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 node under in the tree. You must also use the 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 declared value recorded in the application is greater than $250,000:
AddOnCondition = False
If (oBldgApp.DeclaredValuation > 250000) Then
AddOnCondition = True
End If
This formula adds a condition if the application is for an educational institute:
AddOnCondition = False
If (oBldgApp.OccupancyType.Code.ToUpper = "EDUCATIONAL") Then
AddOnCondition = True
End If
This formula adds a condition if the application is for a new construction:
AddOnCondition = False
If (oBldgApp.WorkType.Code.ToUpper = "NEW") Then
AddOnCondition = True
End if