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
NoodleNoodle 

Mapping two objects

Hi there

I have a situation where I need to create a list of Users, then for each user show their tasks.

So I would like something as follows.

List<User> user = Select Id From User

List<Task> task= Select Name from Task where User = user[0]
List<Task> task= Select Name from Task where User = user[1]
List<Task> task= Select Name from Task where User = user[2]
....
List<Task> task= Select Name from Task where User = user[n]


To explain the context a bit. I'm trying to make a weekly email to EACH user with their open tasks (or other condition, such as Task Status = Late). To do this, I've found that the only solution that might work will be a Visualforce Email Template. 

Thanks in Advance

MandyKoolMandyKool
Hi,

I am not sure; but have you tried reporting? 
I guess you can create a report with open activities and schedule the report.