Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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