Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger insertAtt on Account (after insert) { List<Attachment > lstAtt = new List<Attachment>(); Blob attachmentBody = Blob.valueOf('Test Attachment Body'); // add your attachment body data here in blob var for(account acc : trigger.new){ Attachment temporaryAttachment = new Attachment(); temporaryAttachment.Body = attachmentBody; temporaryAttachment.Name = 'My Test Att.txt'; temporaryAttachment.ParentID = acc.Id; lstAtt.add(temporaryAttachment); } insert lstAtt ; }
Thanks, let us know if it helps you
All Answers
Could you please describe the use case so that would be able to provide a solution.
Regards,
Avishek
Thanks, let us know if it helps you
Piyush_soni__