I would like to be able to query all opportunities that have open events. So far, I know how to do it with SOQL + Apex, but is there a way to do it just with SOQL?
I'm looking for something like this :
SELECT Id, Name,
(SELECT Id, Subject FROM Tasks),
(SELECT Id, Subject FROM Events)
FROM Opportunity
WHERE IsClosed = false
AND StageName != 'Ganada'
AND StageName != 'Perdida'
AND LastModifiedDate <= LAST_N_DAYS:30
AND Id IN (SELECT WhatId FROM Tasks WHERE isClosed = false)
The problem is that I'm getting:
sObject type 'Tasks' is not supported