Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. for (Account account : [SELECT Id, ... FROM Account ...]) {
  2. // Whatever
  3. }
  4.  
  5. Database.getQueryLocator([SELECT Id, ... FROM Account ...]);
  6.  
  7. for(Account acc: [SELECT (SELECT Name FROM Contacts) FROM Account) {
  8. if(acc.Contacts.size() > 100) { // Do something
  9. ...
  10.  
  11. for(Account acc: [SELECT (SELECT Name FROM Contacts) FROM Account) {
  12. Integer totalContacts = 0;
  13. for(Contact[] con: acc.Contacts) {
  14. totalContacts += con.size();
  15. }
  16. if(totalContacts > 100) { // Do something
  17. ...
  18.  
  19. for(List<Account> accounts : [SELECT ID FROM Account]){
  20. for(Account acc : accounts){
  21.  
  22. }
  23. System.debug(count);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement