In the below query, I am trying to extract all Events that have a Opportunity of record type Id = 012240000002Cu8. I also want to further restrict this query based on the opportunity's stage
Select Id,X1st_booked_meeting__c, whatId FROM Event where what.recordtypeId = '012240000002Cu8'
What I am trying to achieve:
Select Id,X1st_booked_meeting__c, whatId FROM Event where what.recordtypeId = '012240000002Cu8' AND what.StageName!='Order Processed' AND what.StageName!= 'Closed Lost'.
what.StageName is throwing an error saying :
No such column 'StageName' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
StageName is standard picklist field on opportunity.
whatId.Stagename does not seem to work.
I would like to know if this is possible?