We're working on a data driven application at the moment and are attempting to return a list of Attachment Id's.
Right now our SOQL query is effectively:
SELECT Id FROM Attachment WHERE LastModifiedDate >= LAST_N_MONTHS:24 LIMIT 100000
But we're getting an
error telling us our query has exceeded 100k results. Any idea how we can successfully limit a query of the Attachment endpoint?
We can obviously limit it to under 100k by limiting the date range but that feels pretty fragile - any recommendations gratefully received.
EDIT: Update to the question I've tried this but Salesforce simply times out on it - even when limited to 1.
SELECT Id FROM Attachment WHERE ParentID IN (SELECT Id FROM <SObject> WHERE LastModifiedDate >= LAST_N_MONTHS:24) LIMIT 100000