This is my first polymorphic query so I could be missing something quite simple here, but is there another way to write this without using the TYPEOF expression? I'm getting the error that "TYPEOF expressions are not supported in this organisation".
Query below:
list<oppSector__c> bSectorList = new list<oppSector__c>();
bSectorList = [SELECT Id, Opp__c, SecNum__c,
TYPEOF What
WHEN Opportunity THEN Id
END
FROM oppSector__c WHERE Opp__c = :stackFlightIDSet];
system.debug('***************Created List*******' + bSectorList.size());
Is this just a matter of getting TYPEOF enabled for the org? Or is there another way of writing this without using the TYPEOF? Opp__c is the relationship field to Opportunity. oppSector__c is the child/detail object. I've tried lots of iterations based on the documentation here but can't seem to return any results in the debug log