Guest User

Untitled

a guest
Jul 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. @isTest Static Void createAttachwithFiles(){
  2.  
  3. //Create Task.
  4. Task t = new Task();
  5. T.subject = 'Creating Attachments';
  6. T.Description = 'The Good, The Bad & The Ugly';
  7. t.Priority = 'High';
  8. insert t;
  9.  
  10. Attachment att = new Attachment();
  11. att.ParentId = t.Id;
  12. Blob bodyBlob = Blob.valueOf('Unit Test Attachment Body');
  13. att.body = bodyBlob;
  14. att.Name = 'attachHarry';
  15. Insert att;
  16.  
  17. }
Add Comment
Please, Sign In to add comment