Below code is returning null for cmap. I am trying to debug contacts as id, contact name pair inside for loop but getting null.
Map<Id, case> caseMap = new Map<Id,case>([SELECT id, accountId, priority from case LIMIT 1]);
list<Id> accountIds = new list<Id>();
for(Id c : caseMap.keyset()) {
if(caseMap.get(c).priority != 'low'){
accountIds.add(caseMap.get(c).id);
system.debug('h:'+cmap);
}
}
Map<Id, contact> cmap = new map<Id, contact>([select id, accountid from contact where accountid =: accountIds]);
IN
keyword in your second query.