Bharat Guru
asked on
How to split the map object in Apex
how to split the map from sql result by filtering the value.
Map<string, AccountList> AccountListMap = new Map<String, [Select Id, Name, AccountType from Accoount where AccountType in ('A','B','C')]>;
How can I get AccountListMap for only AccoountType = 'A' or AccoountType = 'B' ?
Map<string, AccountList> AccountListMap = new Map<String, [Select Id, Name, AccountType from Accoount where AccountType in ('A','B','C')]>;
How can I get AccountListMap for only AccoountType = 'A' or AccoountType = 'B' ?
Try using List<Account> then loop through the list and add each account to the correct part of the map.
ASKER
please provide the sample
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is there anyway to filter map<I’d,Account> without for loop and set it to new map?
AFAIK, you cannot without iterating the map.