• Manasa Dhandapani 7
  • NEWBIE
  • 5 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Here is my code. Please help me with the testclass.
public class AccountContactListController { 
   
   
    @AuraEnabled
    public static List<Contact> fetchAccts(id recordId, String pageSize, String pageNumber) {
         List<Contact> conlist = new List<Contact>(); 
        ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(Database.getQueryLocator('SELECT Id, Name, Title, Status__c, Email, Phone, AccountId, Account_Name_Formula__c FROM Contact where Flag_For_Deletion__c = false AND (AccountId =: recordId OR Account.ParentId =: recordId OR Account.Parent.ParentId =: recordId OR Account.Parent.Parent.ParentId =: recordId OR Account.Parent.Parent.Parent.ParentId =: recordId) ORDER BY Status__c ASC, Name ASC'));
         ssc.setpagesize(Integer.valueOf(pageSize));
        ssc.setPageNumber(Integer.valueOf(pageNumber));
         conlist = (List<Contact>)ssc.getRecords();
        return  conlist;  
      }
Thanks in advance.
Here is my code. Please help me with the testclass.
public class AccountContactListController { 
   
   
    @AuraEnabled
    public static List<Contact> fetchAccts(id recordId, String pageSize, String pageNumber) {
         List<Contact> conlist = new List<Contact>(); 
        ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(Database.getQueryLocator('SELECT Id, Name, Title, Status__c, Email, Phone, AccountId, Account_Name_Formula__c FROM Contact where Flag_For_Deletion__c = false AND (AccountId =: recordId OR Account.ParentId =: recordId OR Account.Parent.ParentId =: recordId OR Account.Parent.Parent.ParentId =: recordId OR Account.Parent.Parent.Parent.ParentId =: recordId) ORDER BY Status__c ASC, Name ASC'));
         ssc.setpagesize(Integer.valueOf(pageSize));
        ssc.setPageNumber(Integer.valueOf(pageNumber));
         conlist = (List<Contact>)ssc.getRecords();
        return  conlist;  
      }
Thanks in advance.