You need to sign in to do that
Don't have an account?
Andre Baxter 7
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.
My Attachment soql query is returning zero rows despite having Attachments in the org
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.
I received my answer from another source. Since I'm working on a newer org, the attachments are likely uploaded as Files, which can be accessed from the ContentVersion system object:
SELECT Id, Title, VersionData FROM ContentVersion