You need to sign in to do that
Don't have an account?
Conner Kinsner 10
Best way to convert List<List<Opportunity>> to List<Opportunity>
i'm retrieving a List<List<Opportunity>> from a map.getValues() where the map definition is Map<String, List<Opportunity>>
I need this in a flat List. As of now, I wrote custom function to do so. But i feel like there's a better way or an out of the box solution to handle this
I need this in a flat List. As of now, I wrote custom function to do so. But i feel like there's a better way or an out of the box solution to handle this
public List<Opportunity> covertListListToList(List<List<Opportunity>> lstlst) { List<Opportunity> lstMappings = new List<Opportunity>(); for (List<Opportunity> opps : lstlst) { for (Opportunity rec : opps) { lstMappings.add(rec); } } return lstMappings; }
https://www.krowd-darden.com/