You need to sign in to do that
Don't have an account?
Visionary
Need help bulkifying a statement
Got a trigger that should update number of cases for a set of accounts.
please help as i'm getting too many SOQL queries error when i do bulk upload.
trigger CaseTrigger on Case (after insert, after update) { Set<Account> accTemp=new Set<Account>(); List<Account> accTemp2 = new List<Account>(); // code to populate accTemp set with Accounts........ for(Account a : accTemp) { cases = [select id, accountid from Case WHERE accountid=:a.id AND isclosed!=true and createdDate >: System.Today()-365 LIMIT 90]; a.Nuber_Of_Open_Cases__c = cases.size(); accTemp2.add(a); } update(accTemp2); }
please help as i'm getting too many SOQL queries error when i do bulk upload.
I think something like that will get you close.
All Answers
I think something like that will get you close.