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 

Can't figure out what wrong with this query?

I'm trying to create a list of tasks that were created today() through a SOQL query so later I can write an if statement in the trigger that would exclude those account that were created today() from the loop.

User-added image
Amit Chaudhary 8Amit Chaudhary 8
Please update your line number 7 like below

(Select AccountID from Task where Task_Created_Date__c = Today) ];

Please check object Name from Tasks to Task
Mahmoud Coudsi 1Mahmoud Coudsi 1
Amit thanks for your help!

I did what you suggusted and now I'm getting this error message: " Compile Error: Entity 'Task' is not supported for semi join inner selects at line 9 column 30 "

User-added image

Do you know of any workarounds that I can do in order to build what I'm trying to build?

Thanks,
Fares.
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 ];


Let us know if this will help you