Guest User

Untitled

a guest
Apr 26th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. if(co.RecordTypeId == ExpieRecordTypeId)
  2. {
  3. Database.DMLOptions dmlOpts = new Database.DMLOptions();
  4. dmlOpts.assignmentRuleHeader.assignmentRuleId= AR.id;
  5. ct.setOptions(dmlOpts);
  6.  
  7. Task CreateTask = new Task();
  8. CreateTask.RecordTypeId = InternalRecordtypeID;
  9. CreateTask.WhatId = co.Id;
  10. CreateTask.ownerid = co.ownerid;
  11. CreateTask.Status = 'In Progress';
  12. CreateTask.Priority='Low';
  13. CreateTask.Subject='EMail';
  14. tasksToInsert.add(CreateTask);
  15.  
  16. }
  17.  
  18. }
  19. Database.upsert(CaseToCreate);
  20.  
  21. if(tasksToInsert.size()>0)
  22. {
  23. insert tasksToInsert;
  24. }
  25.  
  26. }
  27.  
  28.  
  29.  
  30. }
Add Comment
Please, Sign In to add comment