Reply
Regular Contributor
tennvol88
Posts: 16
0

Query for open Tasks associated with Opportunities owned by specific user

Is it possible to construct a SOQL query that will retrieve all of the open Tasks associated with Opportunities owned by a specific user?  I tried using the 'What' relationship for the Task like this:

 

SELECT Id, WhoId, WhatId, Status, Subject FROM Task WHERE IsClosed = 'false' AND What.OwnerId = '<some id>'

 

but the query fails on the What.OwnerId condition.  Apparently only What.Name is valid.  Any thoughts?

Super Contributor
j020
Posts: 743
0

Re: Query for open Tasks associated with Opportunities owned by specific user

Check ownerid = id
If my solution worked for you mark it as resolved and hit KUDOS.
Regards,
J
MicroClouds.in/blogs
Salesforce Certified Developer
Regular Contributor
tennvol88
Posts: 16
0

Re: Query for open Tasks associated with Opportunities owned by specific user

That just gives me the Id of the associated Opportunity which is already available as WhatId.