I am trying to change the due date on task from Developer console and here is my code so far:
list<case> sc = [select Id, casenumber, (select Id, ActivityDate from openactivities) FROM case LIMIT 50]; list<task> oa = new list<task>();
for(case c:sc){
for(task o : c.task){
system.debug(o.ActivityDate);
}
}
But I am getting an error
Invalid field task on case
So how to reference tasks from cases. Can someone help me on this.
Query in the first line is working perfect in workbench to pull records. But when I am using openactivities as child object getting error "Invalid field openactivities on case"
Update: Here is the query I am trying to use after reply by sfdcfox:
SELECT Id, ActivityDate, subject, WhatId FROM Task WHERE WhatId IN (SELECT Id FROM Case)
Requirement: I have cases with case number from 1 to 100 and I need to pull cases with case numbers from 50 to 75. How to add where clause to pull all tasks with case numbers between 50 and 75.
When I try to add WHERE clause to inner query I get an error
Unknown error parsing query
Thanks