Created
December 12, 2015 16:10
-
-
Save keirbowden/4382adba5663dfb9d4f7 to your computer and use it in GitHub Desktop.
Apex controller from the Lightning Component Wrapper Classes blog post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class AccountController | |
{ | |
@AuraEnabled | |
public static List<Account> GetAccountNames() | |
{ | |
return [select id, Name from Account limit 10]; | |
} | |
@AuraEnabled | |
public static List<Account> GetAccountDetails(String idListJSONStr) | |
{ | |
System.debug('idListJSON = ' + idListJSONStr); | |
Type idArrType=Type.forName('List<Id>'); | |
List<Id> ids=(List<Id>) JSON.deserialize(idListJSONStr, idArrType); | |
System.debug('Ids = ' + ids); | |
return [select id, Name, Industry, Website from Account where id in :ids]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment