Here is the simple way to convert list of sobject records to map.
Assigning query result to List:
Assigning query result to Map:
Converting List to Map:
Assigning query result to List:
- //Assigning return query result to the list.
- List<Lead> leadList = [SELECT Id, Name FROM Lead];
Assigning query result to Map:
- //Directly assigning return query result to the map.
- Map<Id, Lead> leadMap = new Map<Id, Lead>([SELECT Id, Name FROM Lead]);
Converting List to Map:
- //Converting list to map
- Map<Id, Lead> mapFromList = new Map<Id, Lead>(leadList);
very informative blog and useful article thank you for sharing with us , keep posting learn more aboutsalesforce training,salesforce online training
ReplyDeletebest training institute to not only get job but to survive in job & be stable:
Deletewww.salesforcestart.com
I have been searching to find a comfort or effective procedure to complete this process and I think this is the most suitable way to do it effectively. Garmin Map Update Download
ReplyDelete**** CSK
ReplyDelete