There are many reasons to use Maps in Apex triggers. Sometimes I want to make a List of Contacts, but I want to pull each one by its ID. This is a good reason to abandon the List and to make a Map<Id, Contact>. (Some will prefer to use Map<String, Contact>, and that is okay […]
Create and Populate a Map Without Loops
There are many reasons to use Maps in Apex triggers. Sometimes I want to make a List of Contacts, but I want to pull each one by its ID. This is a good reason to abandon the List and to make a Map<Id, Contact>. (Some will prefer to use Map<String, Contact>, and that is okay […]