You need to sign in to do that
Don't have an account?
Sandy
Hi, I am trying to implement this trigger but it gives me error
trigger CompleteResolutionTimeMilestone on Case (after update) {
if (UserInfo.getUserType() == 'Standard'){
DateTime completionDate = System.now();
List<Id> updateCases = new List<Id>();
for (Case c : Trigger.new){
if (((c.isClosed == true)||(c.Status == 'Closed'))&& ((c.SlaStartDate <= completionDate)&&(c.SlaExitDate == null))) updateCases.add(c.Id); }
if (updateCases.isEmpty() == false) milestoneUtils.completeMilestone(updateCases, 'Resolution Time', completionDate); } }
error is : CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY : DefaultEntitlement: execution of AfterUpdate
caused by: System.FinalException: Record is read-only
Thanks in advance.
if (UserInfo.getUserType() == 'Standard'){
DateTime completionDate = System.now();
List<Id> updateCases = new List<Id>();
for (Case c : Trigger.new){
if (((c.isClosed == true)||(c.Status == 'Closed'))&& ((c.SlaStartDate <= completionDate)&&(c.SlaExitDate == null))) updateCases.add(c.Id); }
if (updateCases.isEmpty() == false) milestoneUtils.completeMilestone(updateCases, 'Resolution Time', completionDate); } }
error is : CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY : DefaultEntitlement: execution of AfterUpdate
caused by: System.FinalException: Record is read-only
Thanks in advance.
You're trigger seems ok, although I had to reformat it to look for trouble.
I would look for the issue in your milestoneUtils class.
Maybe you could share that too if you want a second opinion.
Best regards,
Ron