I am trying the following SOQL query and getting an error stating the query is malformed.
Select Id from Program__c Where Id In
(Select ParentId from Attachment
where Description LIKE '%Resume%')
I am trying the following SOQL query and getting an error stating the query is malformed.
Select Id from Program__c Where Id In
(Select ParentId from Attachment
where Description LIKE '%Resume%')
I tried the same query using Account rather than Program__c and got the message:
Entity 'Attachment' is not supported for semi join inner selects.
Instead you can rework the query to get the same data.
Select ParentId from Attachment where Description like '%Resume%' and parent.type = 'Program__c'
You already have the ParentId with the ID of the Program__c record so you don't need the In clause.
Note that the Understanding Relationship Query Limitations documentation states:
You cannot filter against the content of textarea fields, blobs, or Scontrol components in any object.
That doesn't appear to be correct with respect to the Attachment Description textarea field as the query returns the expected results.
I see at least one problem, which is that it is not possible to filter on the Description field (or any long-text field for that matter) in the WHERE clause of your SOQL.