You need to sign in to do that
Don't have an account?
Jimmy Brown
Illigle assignment from list to map?
Hi,
I want query some account and assign it into map but it show the Illigle assignment from list to map?
here is code > Map<id,account> accountMap=[select id,name from Account limit 10000];
I want query some account and assign it into map but it show the Illigle assignment from list to map?
here is code > Map<id,account> accountMap=[select id,name from Account limit 10000];
Map<Id, Account> accountMap = new Map<Id, Account>( accounts );
List<Id> returnIds = new List<Id>(accountMap.keySet());
Please follow the below code:-
In the map if you want to assign a list you can't directly assign it, you have a pass that lists as a parameter of the constructor.
If you face any problem then post it.
Please mark it as the best answer if it helps you to fix the issue.
Thank you!
Regards,
Suraj Tripathi.