Print this page

A Milestone's actions are effectively "owned" by a User

Knowledge Article Number 000212249
Description Entitlement rule actions don't re-fire workflow rules or validation rules, but they do fire triggers. If the trigger code causes to error out, then update will fail and thus no workflow/validation rules will fire.

For example : Lets consider a user that has implemented Entitlements,Milestone Actions and also, developed a trigger on Case as below : 
trigger CaseTrigger on Case (before insert, before update,after update, after insert){
   Id LoggedInUser = Userinfo.getUserId();
   for(case caseRecord :{   
    if(caseRecord.OwnerId <> LoggedInUser){                                  
        caseRecord.addError('Please assign case to yourself before making any changes to the case!');

The above basically checks if the LoggedInUser is the case's current owner and if not, displays the error - "Please assign case to yourself."

The above check blows up and as a result the workflow rule/validation rules will not fire. A milestone's actions are effectively "owned" by users who cause them to come into existence. In this case, that's CSTier1 (Customer Support Tier1). So by the time the case is assigned to CSTier2(Customer Support Tier2), the milestones are still on record as being owned by CSTier1. Entitlement rules actions don't re-fire workflow rules or validation rules, but they _do_ fire triggers. So the update fails, because LoggedInUser = <the user who owns the milestone actions> = CSTier1 , while Case.Owner = CSTier2.

This particular failure path doesn't catch any Apex Debug logs. When a failure in an entitlement process happens, it has to fire off an email to the organization admin.
Resolution Suggestions:
  1. The above check needs to be removed or
  2. Create an exception that would only apply to entitlement actions -- 
for example:  Apply the rule if any specific field being touched.

Additional References:

Adding Milestone Actions to Entitlement Processes
Changing Ownership
Milestones not auto-removing when criteria no longer met
Unable to transfer Cases when notify user is checked


promote demote