1

As the title suggests, I'm simply trying to return a list of open tasks for a particular user so I can mass-change owner using Dataloader.

I've worked my way to this query:

SELECT Id, AccountId, Account.Name
FROM Task
WHERE Account.Name = 'John Smith' AND isClosed = false

This is returning no records, however I have checked the users profile and they do have active tasks.

Interestingly, if I change the query to isClosed = true, it returns the list of completed tasks. However that is not what I need.

Furthermore, I've looked into Task fields and there is an "Assigned to" field that indicates to me that I am maybe using an incorrect WHERE clause in my query. Is there an easier identifier to get the name or Id of whoever owns the task?

Thanks in advance.

4

You are retrieving information about the related Account but that doe not mean the Owner of the Task matches the Account Name.

SELECT Id, AccountId, Account.Name
FROM Task
WHERE Owner.Name = 'John Smith'
AND isClosed = false

This query will return the Account information you need for any open Tasks assigned to 'John Smith'.

0
0

I would suggest that you try, OWNER.Name='xxx' in your WHERE clause.

Thanks

1
  • This answer would be improved if you included details about why your suggestion should work, and why OP's current approach is failing (like TSmith's answer does).
    – Derek F
    Oct 2 '18 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.