We get this script exception (in managed package) emailed from a customer instance.
Apex script unhandled trigger exception by user/organization: XXXXX/YYYYY
pkg1.ProductOppStockCheck: execution of BeforeUpdate
caused by: System.QueryException: sObject type 'OpportunityLineItem' is not supported.
It seems below line is causing this exception.
List<OpportunityLineItem> oppLineItemList = [SELECT Id, OpportunityId, Quantity FROM OpportunityLineItem WHERE OpportunityId IN :oppList AND PricebookEntry.Product2.pkg1__Is_Flagged__c = TRUE];
But this error doesn't seem to occur in Dev. or our testing Enterprise edition orgs.
Any reason why OpportunityLineItem is not supported in a Enterprise Ed. org.? Any thoughts, suggestions to find root cause are welcome. Thanks.