You need to sign in to do that
Don't have an account?
ozhere
How to grab all attachments
Hi,
I am trying to get all attachments via SOQL query: "SELECT Name,Id, ParentId,Body FROM Attachment".
But above query returns only one record.
If I remove the Body from the query (SELECT Name,Id, ParentId FROM Attachment), I get all attachment records.
Is there a way to grab all attachments with Body via SOQL???
Thanks
-O
All Answers
Thank you, SimonF!
When I query attachments with Body in query, the response returns every field as a separate record.
So when I $query = "Select a.Body, a.Id, a.LastModifiedDate, a.Name, a.ParentId, a.SystemModstamp from Attachment a";
foreach ($response->records as $record) {
print_r($record);
echo "<br/>";
}
I get Body value, then Id value, etc., instead of stdClass Object. Do you know how to avoid this and get whole attachment record as stdClass Object??
Thank you!
-O