Skip to content

Instantly share code, notes, and snippets.

View Attic0707's full-sized avatar

Samet Atik Attic0707

View GitHub Profile
@mannharleen
mannharleen / AccountProcessor.cls
Created October 31, 2016 15:32
Salesforce trailhead - Asynchronous Apex Using Future Methods
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