Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. trigger EsclateCase on Task (after insert) {
  2. list<CaseComment > cc = new list<CaseComment >();
  3. for(Task t : Trigger.new){
  4. string relatedTo = t.WhatId;
  5. Boolean IsRelatedToCase = relatedTo.startsWith('500');
  6. if(t.Escalated__c == true && IsRelatedToCase){
  7. CaseComment tempCC = new CaseComment(ParentId=relatedTo,CommentBody='This case is escalated');
  8. cc.add(tempCC );
  9. }
  10. }
  11. insert cc;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement