Loading
メールアドレスがデフォルトのログイン方式となります 続きを読む
Scalability
ApexGuru Antipattern: SOQL in a Loop

ApexGuru Antipattern: SOQL in a Loop

Executing SOQL queries inside loops can quickly exhaust the governor limits and decrease system performance. Salesforce enforces a limit on the number of queries per transaction. Instead, batch SOQL queries outside of loops.

Scope

Detection only

Detection Example

apex
for (Integer i = 0; i < 10; i++) {
      List<Account> accounts = [SELECT Id FROM Account WHERE Name = :someValue];
  }
 
読み込み中
Salesforce Help | Article