Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trigger EsclateCase on Task (after insert) {
- list<CaseComment > cc = new list<CaseComment >();
- for(Task t : Trigger.new){
- string relatedTo = t.WhatId;
- Boolean IsRelatedToCase = relatedTo.startsWith('500');
- if(t.Escalated__c == true && IsRelatedToCase){
- CaseComment tempCC = new CaseComment(ParentId=relatedTo,CommentBody='This case is escalated');
- cc.add(tempCC );
- }
- }
- insert cc;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement