function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Map<String,List<Contact>> firstMap = new Map<String,List<Contact>>(); Map<string,string> anotherMap = new Map<string,string>(); List<Account> acList = [select id,name,(select id,lastname from contacts) from account ]; for(Account ac : acList){ if(ac.contacts.size() != null){ firstMap.put(ac.Id,ac.contacts); anotherMap.put(ac.Id,ac.Name); } } system.debug('<<firstMap is :>>'+ firstMap); Map<string,Map<String,List<Contact>>> secondMap = new Map<string,Map<String,List<Contact>>>(); for(Account ac : acList){ secondMap.put(anotherMap.get(ac.Id).Name,firstMap); } system.debug('<<Second Map is : >>'+secondMap);
Map<String,List<Contact>> firstMap = new Map<String,List<Contact>>(); List<Account> acList = [select id,name,(select id,lastname from contacts) from account ]; for(Account ac : acList){ firstMap.put(ac.Id,ac.contacts); } system.debug('<<firstMap is :>>'+ firstMap); Map<string,Map<String,List<Contact>>> secondMap = new Map<string,Map<String,List<Contact>>>(); for(Account ac : acList){ secondMap.put(ac.name,firstMap); } system.debug('<<Second Map is : >>'+secondMap);
List<Account> lstAccount = [SELECT Id,Name,(SELECT Id, Name FROM Contacts) FROM Account]; for(Account acc : lstAccount) { this.accountContactMap.put(acc.id, acc.Contacts); }
try this ..
Thanks
Sandeep
All Answers
As per my Understanding i have done something which meet criteria that u define.
Let me know it is helpful or not for you.
Thanks
Sandeep
We are doing same Sanndeep, but I want account name of every Id which is stored in your firstMap map.
try this ..
Thanks
Sandeep