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
Mahmoud Coudsi 1Mahmoud Coudsi 1 

Entity 'Task' is not supported for semi join inner selects at line 9 column 30

Problem:

I created an Apex trigger that evaluates multiple conditions on the Accounts object (through if statements). If the conditions are met then the trigger creates a task related to the Accounts (that meets the conditions)

Now, since the trigger after update type of trigger, tasks are being created everytime the account is edited or saved. I tried to create a list of tasks that were created today() through a SOQL query so later on I can write an IF statement inside the trigger's loop that would exclude those accounts that were created today() from the loop. 

I keep getting this error message: Entity 'Task' is not supported for semi join inner selects at line 9 column 30

User-added image

Thanks for your help in advance,
Fares.  
Best Answer chosen by Mahmoud Coudsi 1
Amit Chaudhary 8Amit Chaudhary 8
Try to update your line 9 like below

List<Task> todaysTask = [  select accountid from task where Task_Created_Date__c = Today ];