You need to sign in to do that
Don't have an account?
VarunC
I'm unable to fetch ALL my Attachment records via SOQL query
Every time I try to run this query i get only 2 results:
Attachments[] records = [Select Name, ParentId, OwnerId, Id, Body, ContentType, Description, IsPrivate From Attachment Where Parent.Type IN ('File__c') AND Owner.IsActive = true];
I know including "Body" field will limit number of records returned in Eclipse to only 1, BUT I'm using this query in APEX class and in Debug Log as well but I'm only able to read 2 record everytime, but the total count of Attachment record returned from this query Should be 4152 records which it is not giving.
Is it some Bug?
You'll need to use the query loop syntax,
for (Attachment [] atts : [select name, body from attachment]) {
// do something with atts
system.debug ( atts.size() );
}
All Answers
You'll need to use the query loop syntax,
for (Attachment [] atts : [select name, body from attachment]) {
// do something with atts
system.debug ( atts.size() );
}
Thanks... That worked.
But I actually even tried batching using StandardSetController for the query with pageSize of 1, 10 and 100 etc ... but using StandardSetController throwed "Internal Salesforce.com Error" ....
Showbox (https://showbox.software/)| Kod (https://kodi.software/)i | Lucky Patcher (https://luckypatcher.pro/)|