Use Case - We need to have validation in apex code if any of the information missed we need to throw error. First Name, Last Name, SSN or DOB etc. Assume we have opportunity Id as parameter, will query Account information and add into a wrapper class. Public class ResidentDetailRequest { @AuraEnabled public Integer FacilityNumber; @AuraEnabled public String FacilityName; @AuraEnabled public String LastName; @AuraEnabled public String FirstName; @AuraEnabled public String MiddleName; @AuraEnabled public String SSN; @AuraEnabled public String DOB; @AuraEnabled public String Suffix; } Main class. public class ResidentValidationController { //public static ResidentDetailRequest resident; @AuraEnabled(cacheable=true) public static ResidentDetailRequest getResidentFromOpportunity(String opptyId){ Oppo...
A place where you have to land for exploring Salesforce