You need to sign in to do that
Don't have an account?
Case assignment rules don't get executed when running trigger on attachment
I have written a couple of Apex triggers that fire Before Insert on the case and that does sucessfully trigger the assigment rules. Everything is fine.
Now I added a trigger that fires when a user adds an attachment to a case. The trigger successfully updates the case status as intended but the case assigment rules are not invoked. Drat!
trigger NewAttachment on Attachment (after insert) { List<Case> CasesToUpdate = new List<Case>(); for (Attachment t: Trigger.new){ try{Case c = new Case(Id = t.ParentId); c.Status='New Case'; CasesToUpdate.add(c); }catch (Exception e){ } } update CasesToUpdate; }
(I did not write this code myself, only modified it from a post on these forums)
As far s I understand, the assignment rules should fire when the cases are updated. But they don't seem to do that. I have double and triple checked the string 'New Case'
Any thoughts?
Here you go.......
http://boards.developerforce.com/t5/Apex-Code-Development/case-active-assignment-rules/td-p/237669
All Answers
Here you go.......
http://boards.developerforce.com/t5/Apex-Code-Development/case-active-assignment-rules/td-p/237669
My Hero!
Thx a lot for your help. Solved the problem nicely.
For reference, the code looks like this now:
Cheers,
/Mats