Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tushar30
Created May 21, 2018 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tushar30/972a18ef249ba7c8edf75c379bd392e6 to your computer and use it in GitHub Desktop.
Save tushar30/972a18ef249ba7c8edf75c379bd392e6 to your computer and use it in GitHub Desktop.
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