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 Inspection milestone that advances an abandoned vehicle case to Resolved if the inspector can resolve the problem during initial inspection, or Follow-Up if the inspector must return to verify that the abandoned vehicle has been taken care of. You specify a next milestone formula when you define a new milestone or change an existing milestone.

Next milestone formulas use the oCase object (an instance of the Hansen.CDR.CodeEnforcement.iCase class) to set NextState 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.

Examples

This formula advances to the Resolved milestone if the case has a Resolved resolution code.


If oCase.ResolutionCode.Code.ToUpper = "RES" Then
  NextState = "Resolved"
End If

This formula advances the case to a Level 2 milestone if the case has a Medium priority, advances the case to a Level 3 milestone if the case has a High priority level, and advances the case to a Level 1 milestone for all other priorities.


If (oCase.Priority.Code.ToUpper = "MED") Then
  NextState = "Level 2"
Else If (oCase.Priority.Code.ToUpper = "HIGH") Then
  NextState = "Level 3"
Else
  NextState = "Level 1"
End If

This formula advances a case to a Compliance Check milestone 15 days after the results of a Verification inspection were recorded.


dim oInspection as Hansen.CDR.CodeEnforcement.IInspection
For Each oInspection in oCase.Inspections
  If ((oInspection.InspectionType.Code.ToUpper = "VERIFICATION") 
  And (System.DateTime.Now = 
  oInspection.InspectionResult.ModifiedDateTime.AddDays(15))) Then
    NextState = "Compliance Check"
  End If
Next oInspection