You need to sign in to do that
Don't have an account?

SOQL Query
Whats the best way to get
Map<String,id> accountNameVsId = [Select id, Accountname form account];
Please suggest
You need to sign in to do that
Don't have an account?
Whats the best way to get
Map<String,id> accountNameVsId = [Select id, Accountname form account];
Please suggest
map<id,Account> mapAccs = new map<id,Account>([select id,name from Account]);
Now Each account is mapped to Id of that account.
All Answers
there maybe a more elegant way but I would do:
map<id,Account> mapAccs = new map<id,Account>([select id,name from Account]);
Now Each account is mapped to Id of that account.
Thanks,
For the quick solution