0

In my org i have a lot attachments available (55,000) and i need to export only those attachments which has Account.field__c = 'ABC' (10,000).

I am not sure this is possible in SOQL or not as i tried and it gives me an error, can anyone please tell me how to export those attachments only ?

What i have tried : Select Body, Name, ParentId from Attachment where Parent.Type = 'Account' AND Account.field__c = 'ABC'

I know above where clause is very typical but hopefully it might let you understand what exactly i need.

Thanks.

1 Answer 1

2

You can use a subquery filter for this:

SELECT Body, Name, ParentId 
FROM Attachment
WHERE ParentId IN (SELECT Id FROM Account WHERE Field__c = 'ABC')
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .