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
Chris CruzChris Cruz 

Filtering Opportunities by Tasks using SOQL?

I'd like to pull all Opportunity IDs that have a task associated with a certain person. 

I've tried the following

Select ID from Opportunity where AccountID IN (Select AccountID From TASK WHERE CreatedBy.Name='Person' OR LastModifiedBy.Name='Person' )

But I get the following error 
ERROR at Row:1:Column:80 Entity 'TASK' is not supported for semi join inner selects"

Is there any work around to this
pconpcon
Since the task does not support semi join inner selects, you will have to split this out as two queries, and build up a set of account Ids and pass that to your Opportunity SOQL.

If you want to make it so the platform can support this type of join, I'd suggest voting on this in the idea exchange  https://success.salesforce.com/ideaView?id=08730000000J68o