You need to sign in to do that
Don't have an account?

Accsessing attachments using Apex
Hello Apex experts!
I need to be able to get the link of an attachment and download the file to a diffrent server. On the record that has the attachment, I need to have a button that triggers this.
Is there some way to loop all the attachments in the record?
Thanks,
David
Hi,
Is your problem resolved? If not:
1) Salesforce stores all the attachments under object "Attachment"
2) So, in your apex code you can iterate on these attachments.
e.g List<Attachment> lstAttachments = [Select Id,Body,ParentId from Attachment where ParentId : = {Your record Id}];
This should give you all the attachments related to your record.
Sheetal