FavoriteBob Smith asked in #ApexApr 7, 2015, 7:55 AMCan we Use DML(Delete) on Map Collection TypeCan't we delete Records by using Map Collection Type....?Map<Id, Account> m = new Map<Id,Account>([Select id from Account Limit 3]);delete m;How to achieve by using Map? 1 answerSortSort by Most HelpfulSort by Most HelpfulSort by DateAccepted AnswerKeir Bowden (Credera)Apr 7, 2015, 8:15 AMYou can't use a map, but you can simply pass the values list from the map as follows: Map<Id, Account> m = new Map<Id,Account>([Select id from Account Limit 3]);delete m.values(); Write an answer...BoldItalicUnderlineStrikethroughBulleted ListNumbered ListAdd linkCode blockInsert imageAttach filesLink URLCancelSave0/9000Reply
Accepted AnswerKeir Bowden (Credera)Apr 7, 2015, 8:15 AMYou can't use a map, but you can simply pass the values list from the map as follows: Map<Id, Account> m = new Map<Id,Account>([Select id from Account Limit 3]);delete m.values();