apex loop through map code example
Example 1: loop through map apex
for (Id key : Map.keySet()) {
// The "key" variable is also available inside the loop
List<String> list = Map.get(key);
// logic
}
Example 2: how to iterate map in apex salesforce
for(Id id: mapname.keyset()){
Set<String> stringset= mapname.get(id);
for(String a: stringset){
sendMail(a);
}