I have tried a few different methods to query for the Attachments in my org, but zero rows are always returned.
I ran this query in the query editor in dev console, but zero rows were returned:
select id, name from Attachment
The same result occurred when I ran below code in the execute anonymous window:
for (Attachment [] atts : [select name from attachment]) {
// do something with atts
system.debug ( atts.size() );
}
I'm expecting at least two rows to be returned on a Opportunity record that I'm using for testing. Is there something on the configuration end that I need to set up so that I'll be able to retrieve the attachments via soql? I'm guessing that there's something simple that needs to be tweaked that I overlooked.