I'm coding a trigger on case and I'm using this query to get some data fields information from CaseMilestone entity:

Select caseid,MilestoneTypeId,CompletionDate,ElapsedTimeInMins,IsCompleted,IsViolated, 
                        from CaseMilestone where caseid= :c.id

I need to use other fields from a new entity EntityMilestone:

  • ActualElapsedTimeInDays
  • StoppedTimeInDays

How can i link these 2 entities?

  • The object reference for EntityMilestone says "Milestones on cases use the CaseMilestone object type". Can you elaborate on how you're trying to use this object? – David Reed Oct 17 at 14:02
  • Thanks for your reply! i'd like to use those 2 fields inside my query! Which is the best practice to link them? – Marco Moscatelli Oct 17 at 14:08
  • I'm not an expert in entitlement management, but the documentation suggests that unless you're using Work Orders or Field Service Lightning, you can't use that object. Hopefully a Service Cloud/Entitlement expert can chime in here. – David Reed Oct 17 at 14:15
up vote 3 down vote accepted

If you are working on Cases with Milestones then the appropriate object is CaseMilestone which is available from API version 18.0 or later.

Where as EntityMilestone Represents a required step in a customer support process on a work order. The Salesforce user interface uses the term “object milestone.” This object is available in API version 37.0 and later.

And EntitlyMilestone is not related to Case.

  • i'm doing this query: SELECT ActualElapsedTimeInDays , CaseId FROM CaseMilestone WHERE isDeleted = false ORDER BY Id DESC NULLS LAST – Marco Moscatelli Oct 18 at 8:24

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.