Calculating the next milestone

You can direct Infor Public Sector to calculate which milestone will follow another milestone using a next milestone formula.

For example, you could write a formula for an Awaiting Approval milestone that advances a sewer line replacement work order to an Approved milestone if it receives an approval or an Under Review milestone if it was not approved and requires changes. You specify a next milestone formula when you define a new milestone or change an existing milestone.

Next milestone formulas use the oWorkOrder object (an instance of the Hansen.WorkManagement.WorkOrder class) to set NextMilestone to a string value that is the exact name of the milestone that follows it. For more information about this object and for sample code, click the Information tab in the Formula Editor.

Using the ProcessStatusChecks Method

Ordinarily the progression formula will advance a work order regardless of unsatisfied status checks or pending approvals at the current milestone. If you want unsatisfied status checks or pending approvals to halt milestone progression, you can use the ProcessStatusChecks method on the oWorkOrder object. This method sets a Boolean parameter to true if all status checks for a work order’s current milestone are satisfied, and if there are no pending approvals on the work order.

Examples

This formula advances the work order to a Pre-Assignment Vehicle in Shop milestone if the location of the vehicle has been moved to an auto shop.


If (oWorkOrder.Asset.Location = "In Shop") Then
   NextMilestone = "Pre-Assignment Vehicle in Shop"
End If

This formula advances the work order to a In Work milestone if the work order has been flagged as started.


If (oWorkOrder.IsWorkStarted = True) Then
   NextMilestone = "In Work"
End If