+ Start a Discussion
Tom DJTom DJ 

System.QueryException: sObject type 'Lead' is not supported.

 

 

I am getting the following exception error from one of our customer for an App Exchange application (managed package)

 

  System.QueryException: sObject type 'Lead' is not supported. 

 

This is thrown when I do the following dynamic SOQL query from an "After" trigger.

 

  select Name,Id,OwnerId,Email from Lead WHERE (Email = 
'someone@yahoo.com') AND (IsConverted != TRUE) AND (Id != 
'00Q6000000RPkKPEA1') Limit 15 

 

The User Type is "LIcenseManager" and the customer has an App Exchange application, so I am pretty sure this is LMA that is having the issue with our trigger.  

 

The query is being called from a class that has "with sharing" keywords, so there could be restrictions on the query, but I am finding it hard to believe that LMA's would not have access to the Lead object because (and correct me if I am wrong)  it manages the leads that are generated when apps are downloaded.

 

Thanks in Advance.

 

Tom DJ.