0

I've taken a reference from link : How to track SLA/OLA for different processes in Salesforce? and now wanted to ask about violated scenarios.

I've the following questions in my mind:

  1. Can two milestones be execute at the same time if the milestones are independents of each other ?
  2. Can we not execute milestone-2 if milestone-1 fails or violated ? Do we need to wait for the someone to initiate milestone-1 and then only completion of milestone-1, milestone-2 can be executed ?
| improve this question | | | | |
1

Salesforce does not complete the milestone automatically.

You need to run a code to complete the milestone. It is possible multiple milestones are run simultaneously if you don't complete other ones.

Code to complete milestone is as follows:

public class MilestoneUtils 
{
    public static void completeMilestone(List<Id> caseIds, DateTime complDate) 
    {

        List<CaseMilestone> cmsToUpdate = [select Id, completionDate
                                            from CaseMilestone cm
                                            where caseId in :caseIds and IsCompleted =False
                                            and completionDate = null limit 1];
            if (cmsToUpdate.isEmpty() == false)
            {
                for (CaseMilestone cm : cmsToUpdate)
                {
                    cm.completionDate = complDate;
                }
            update cmsToUpdate;
            }
    }
}

Secondly milestones can be initiated based on certain values on Case record. Let's say you have written a logic, if case status is in-progress and case type is "Accounting" then new milestones gets created.

So, during creation, system will not look for any previous milestones running or not.

Refer Milestone Recurrence Types

| improve this answer | | | | |
  • Is that my answer serves for you? – Santanu Boral Jul 29 '17 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy