Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (Account account : [SELECT Id, ... FROM Account ...]) {
- // Whatever
- }
- Database.getQueryLocator([SELECT Id, ... FROM Account ...]);
- for(Account acc: [SELECT (SELECT Name FROM Contacts) FROM Account) {
- if(acc.Contacts.size() > 100) { // Do something
- ...
- for(Account acc: [SELECT (SELECT Name FROM Contacts) FROM Account) {
- Integer totalContacts = 0;
- for(Contact[] con: acc.Contacts) {
- totalContacts += con.size();
- }
- if(totalContacts > 100) { // Do something
- ...
- for(List<Account> accounts : [SELECT ID FROM Account]){
- for(Account acc : accounts){
- }
- System.debug(count);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement