Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class MapIterationController {
@AuraEnabled
public static Map < String, String > fetchMapData() {
Map < String, String > mapOppAccount = new Map < String, String >();
for(Opportunity opp : [SELECT ID, Account.Name, Name FROm Opportunity LIMIT 5])
mapOppAccount.put(opp.Name, opp.Account.Name);
return mapOppAccount;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment