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
ReplyDeleteA python training program provides complete knowledge from beginner to advanced levels. It includes structured lessons and practical examples. This python training improves coding efficiency and problem-solving ability. It focuses on real-world use cases. Students build functional applications. It is professional.
ReplyDeleteBest Tableau training helps learners analyze complex datasets and present insights through powerful dashboards. It explains forecasting and trend analysis clearly. This best tableau training strengthens data storytelling and visualization skills. Learners complete real-time projects. Industry examples are included. Expert mentorship is provided. It prepares successful BI careers.
ReplyDelete