I'm working with a SOQL query that is supposed to find all Cases related to Consumer Contract that have attachments.
Cases -----> Attachment, related to Consumer Contract.
I'm able to narrow down cases that are related to the Consumer Contract, however, I'm unable to only pull those cases that are related AND have attachments.
My current query looks like:
Select Id, (Select Id, ParentId
From Case.Attachments
WHERE (NOT Description LIKE 'Redaction Audit%'))
FROM Case
WHERE Case_Consumer_Contract_CC__c != null
AND CreatedDate > 2016-02-01T00:00:00.000Z
The attachment object has two fields ID, and ParentID.
Thank you in advance!
Attachments
then getParentId
and then query onCase