Skip to content

Instantly share code, notes, and snippets.

@keirbowden
Created December 12, 2015 16:10
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save keirbowden/4382adba5663dfb9d4f7 to your computer and use it in GitHub Desktop.
Save keirbowden/4382adba5663dfb9d4f7 to your computer and use it in GitHub Desktop.
Apex controller from the Lightning Component Wrapper Classes blog post
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