Skip to content

Instantly share code, notes, and snippets.

@simpluslabs
Created March 12, 2019 05:46
Show Gist options
  • Save simpluslabs/38cc66f62af1c69b961f9d248f5af5b6 to your computer and use it in GitHub Desktop.
Save simpluslabs/38cc66f62af1c69b961f9d248f5af5b6 to your computer and use it in GitHub Desktop.
/**
* Created by NigamGoyal on 3/11/2019.
*/
public with sharing class AccountController {
@AuraEnabled(cacheable=true)
public static List<Account> getAccountRecordWithRelatedContactList(Id recordId) {
List <Account> accountList = new List<Account>();
accountList = [Select Id,(Select Id, FirstName, LastName, Title, Phone, Email FROM Contacts) from Account WHERE Id = :recordId];
return accountList;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment