You need to sign in to do that
Don't have an account?
happy dev
code is good in sandbox but has error when deployed to production
I have code to draw around 200 districts from a custom object. It works fine in sandbox but failed when it is deployed to production. Anyone knows why? The error is "Too many SOQL queries: 101", Failure Stack Trace: "
Map<Id, District__c> DistrictById = new Map<Id, District__c>([SELECT Id, Name FROM District__c]);
Thanks
This sounds like your query is coming after 100 other queries. Is this inside a loop or a trigger or similar? You'll need to track down what is happening prior to this query being executed.