I have a map of List for custom wrapper object records as below
Map<String, List<Custom wrapper object>>
I want to get all the records in one list together irrespective of the key of map.
How can this be achieved?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityIt's a pretty simple structure to flatten.
List<MyWrapper> flattened = new List<MyWrapper>();
for (List<MyWrapper> collection : myMap.values())
flattened.addAll(collection);