public with sharing class ContactTableController { @AuraEnabled(cacheable=true) public static List getContacts(Id parentId) { if (parentId == null) { return new List(); } // For demo: assume parent is Account. You can extend to support other parents if needed. List records = [ SELECT Id, Name, Title, Phone, Email, AccountId FROM Contact WHERE AccountId = :parentId ORDER BY LastName, FirstName LIMIT 5000 ]; // Enforce field-level and object-level security // Remove fields the running user doesn't have access to SObjectAccessDecision decision = Security.stripInaccessible(AccessType.READABLE, records); return (List) decision.getRecords(); } }