Latest Posts › Forums › Project Scenarios Lightning Aura Component › Milestone Completion Date Error
- This topic has 1 reply, 1 voice, and was last updated 9 months, 2 weeks ago by Admin.
- AuthorPosts
- AdminKeymaster
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 3 years, 5 months ago by Admin.
KittyGuestIf 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>’ - AuthorPosts