function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Retrieve list of cases having attachments attached to it

I want to take back up of all cases which are created before 1/1/2008 and having attachments attached to it.

1. I am not able to create a report on the Attachments object

2. Through data loader when i am querying like:

Select Id, CaseNumber, CreatedDate, CreatedById, LastModifiedById,(Select ContentType,id,ParentId From Attachments) FROM Case where CreatedDate<2008-01-01T00:00:00Z

The csv file is not returning attachment details.


How can i accomplish this requirement?


Thanks in advance!!



As i think  You cannot extract 2 objects at a time. Firstly you have to extract Case using this query

Select Id, CaseNumber, CreatedDate, CreatedById, LastModifiedById FROM Case where CreatedDate<2008-01-01T00:00:00Z
Now extract the Attachment. From here you have to make filter on the Parent ID of Attachment sheet(extracted sheet) that are related to the case id present in the Case extracted sheet. It will show all the attachment related to that cases.

Please let me know if there is any issues.


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.