You need to sign in to do that
Don't have an account?
![Abhishek Pal 33 Abhishek Pal 33](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Does validation rules or workflow counts for SOQL queries(100) governor limits?
Hello Everyone,
In one of the apex class I am hitting the SOQL queries governor limit. But I have not written any SOQL statements in it.
For the below code I am getting Number of Queries used in this Apex code so far in updateStoreStatus: 100.
Code:-
List<Account> updateAccounts = new List<Account>();
List<Id> updateAccountIds = new List<Id>();
// Check if the TD Status changed from closed to open or pending to open for(Account newAccount : newAccounts.values()) {
if( (newAccount.TD_Status__c == 'Open') &&
(oldAccounts.get(newAccount.id).store_Status__c == 'Closed' || oldAccounts.get(newAccount.id).store_Status__c == 'Pending' )) {
updateAccountIds.add(newAccount.id);
}
}
System.debug(LoggingLevel.INFO,'UpdateStoreList Size' + updateAccountIds.size());
Can someone please help how this code giving me 100 SOQL execution.?
NOTE:- If I check logs I can see lots of workflow and validation rules are executing.
Thanks in advance.
-Abhishek
In one of the apex class I am hitting the SOQL queries governor limit. But I have not written any SOQL statements in it.
For the below code I am getting Number of Queries used in this Apex code so far in updateStoreStatus: 100.
Code:-
List<Account> updateAccounts = new List<Account>();
List<Id> updateAccountIds = new List<Id>();
// Check if the TD Status changed from closed to open or pending to open for(Account newAccount : newAccounts.values()) {
if( (newAccount.TD_Status__c == 'Open') &&
(oldAccounts.get(newAccount.id).store_Status__c == 'Closed' || oldAccounts.get(newAccount.id).store_Status__c == 'Pending' )) {
updateAccountIds.add(newAccount.id);
}
}
System.debug(LoggingLevel.INFO,'UpdateStoreList Size' + updateAccountIds.size());
Can someone please help how this code giving me 100 SOQL execution.?
NOTE:- If I check logs I can see lots of workflow and validation rules are executing.
Thanks in advance.
-Abhishek
But I am not seeing any such condition where the code becomes recursive.
One more things when I check logs I see lots of validation rules/workflows executed before this method. Does this leads to increasing the SOQL governor limits. If yes Can you please help how to overcome this error.
-Abhishek