+ Start a Discussion
Anoop Kumar 31Anoop Kumar 31 

write a soql query to fetch 500 account records in a list and convert it into a map of accountid and account record

Please answer anyone??
Shweta AlwaniShweta Alwani
Try to use this,

Map<Id, Account> accountMap = new Map<Id, Account>([SELECT ID, Name FROM Account LIMIT 500]);
v varaprasadv varaprasad
Hi Anoop,

 Check below URL :

Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.

@For SFDC Support: varaprasad4sfdc@gmail.com
Blog: http://salesforceprasad.blogspot.com/

Salesforce latest interview questions  :