Milestone Completion Date Error

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1127 Reply
    Admin
    Keymaster

    I’m trying to write a trigger for Case that will reopen or uncomplete the Final Milestone in the Entitlement Process for that Case. I have run up against getting an error

    “FIELD_INTEGRITY_EXCEPTION, You can’t change the Completion Date on a Milestone that’s already exited an Entitlement Process”

    • This topic was modified 2 months, 2 weeks ago by Admin.
    #1129 Reply
    Kitty
    Guest

    If the Case is already in Closed status and if you have any processes to update the Milestone Completion Date, you will run into this error.

    Update the CaseMilestone before the case saves as closed as the milestone must already be closed when the case is closed. Use a before update trigger on your case, and make sure that you update your completion date prior to closing the case. You can use System.now() for picking the time.

    SOQL to update CompletionDate:
    SELECT Id, CompletionDate FROM CaseMilestone WHERE CaseId = ‘<Case Id>’

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Milestone Completion Date Error
Your information:




error: Content is protected !!