Here is the SOQL query I am trying to make:
List<Task> tasks = [ SELECT Id,ActivityDate,Status,Subject FROM Task WHERE What.Type = 'nexus__Goal__c' AND (What.nexus__Quarterly_Sales_Plan__c = 'a0EU0000004wz6B') LIMIT 101 ];
nexus__Quarterly_Sales_Plan__c is a valid custom field I created on the
nexus__Goal__c object, which is a valid target of the Task object's Polymorphic 'What' field.
When I run this query, I get the following error:
No such column 'nexus__Quarterly_Sales_Plan__c' 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.
Will I have to wait for SOQL Polymorphism in Winter 13 in order for this Query to work? Or is there any way to make this work by specifying What.Type as I tried to do?