Calculating whether to add a review
You can use an AddOnCondition formula to calculate whether a review is added to an application. For example, you could write a formula that requires an environmental impact study for any industrial complex.
AddOnCondition formulas use the oPlanningApp
object (an instance of the Hansen.CDR.Planning.iPlanningApplication
class) to set AddOnCondition
to either True or False.
You can also use properties and methods of the Review
object in your
formula. For example, you might want to specify the review types that the formula applies to.
To access review properties, select the node
under in the tree. You must also use the node to indicate the type of record
(AssociatedRecordType.Review
).
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 $1,000,000:
AddOnCondition = False
If (oPlanningApp.DeclaredValuation > 1000000) Then
AddOnCondition = True
End If
This formula adds an item if the application is for an industrial complex:
AddOnCondition = False
If (oPlanningApp.OccupancyType.Code.ToUpper = "INDUSTRIAL") Then
AddOnCondition = True
End If
This formula adds an item if the application is for a new construction:
AddOnCondition = False
If (oPlanningApp.WorkType.Code.ToUpper = "NEW") Then
AddOnCondition = True
End if