This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AccountProcessor { | |
@future | |
public static void countContacts(List<Id> accountId_lst) { | |
Map<Id,Integer> account_cno = new Map<Id,Integer>(); | |
List<account> account_lst_all = new List<account>([select id, (select id from contacts) from account]); | |
for(account a:account_lst_all) { | |
account_cno.put(a.id,a.contacts.size()); //populate the map | |