Calculating whether to add a detail
Specify an Add On Condition formula for a detail when you define an activity detail. For example, you could write a formula that requires a hazardous substance detail for any cleaning work that may use hazardous cleaning agents, or a formula that requires a work zone detail that records the location and detour route for major street work.
Add on condition formulas use the oWorkOrder
object (an instance of the Hansen.WorkManagement.WorkOrder
class) to set bInclude
to either True or False. If the formula returns True, the detail is added to the work order. If the formula returns False, the detail is not added to the work order. For more information about this object and for sample code, click the Information tab in the Formula Editor.
Examples
This formula adds an item if the asset will be put out of service during the performance of the work order.
If (oWorkOrder.CausesOutage = True) Then
bInclude = True
Else
bInclude = False
End If
This formula adds an item if the type of vehicle used for the work order is a one-ton cargo truck.
If (oWorkOrder.VehicleCosts.VehicleType = "Cargo1Ton") Then
bInclude = True
Else
bInclude = False
End If