MilestoneTriggerTimeCalculator Interface

The Support.MilestoneTriggerTimeCalculator interface calculates the time trigger for a milestone.

Support

Implement the Support.MilestoneTriggerTimeCalculator interface to calculate a dynamic time trigger for a milestone based on the milestone type, the properties of the case, and case-related objects. To implement the Support.MilestoneTriggerTimeCalculator interface, you must first declare a class with the implements keyword as follows:

Next, your class must provide an implementation for the following method:

The implemented method must be declared as global or public.

The following are instance methods for MilestoneTriggerTimeCalculator.

Calculates the milestone trigger time based on the specified case and milestone type and returns the time in minutes.

public Integer calculateMilestoneTriggerTime(String caseId, String milestoneTypeId)

  • caseId:

    Type: String

    ID of the case the milestone is applied to.

  • milestoneTypeId:

    Type:

    String ID of the milestone type.

Type:

Integer The calculated trigger time in minutes.

This sample class demonstrates the implementation of theSupport.MilestoneTriggerTimeCalculator interface. In this sample, the case’s priority and the milestone m1 determine that the time trigger is 18 minutes.

This test class can be used to test the implementation of Support.MilestoneTriggerTimeCalculator.