You need to sign in to do that
Don't have an account?
guest1231231
Getting Id value from a Map List Collection
How do I get the Opportunity Id value from the list collection in the map OppsMap?
List<Account> Accts = new List<Account>{};
Accts = [select Id, First_Contact_Date__c, (select Id from Opportunities) from Account];
Map<Id, List<Opportunity>> OppsMap = new Map<Id, List<Opportunity>>{};
for(Account a: Accts) {
OppsMap.put(a.Id, a.Opportunities);
}
-Thanks
Not knowing exactly what you are trying to do here's some code to get your started in the right direction:
Nested "for" loops might run into issues with Governor limits depending on what you do inside the innner for loop.