沙世明
2022-04-08 eeb7c0a2d6f037d515bb822d739036b69c4dc73a
force-app/main/default/classes/CM_SearchContactServiceController.cls
@@ -22,8 +22,9 @@
        //1. Query Contact by accountId
        List<Contact> conList = new List<Contact>();
        system.debug('Account Id from Front-end:'+accountId);
        PIHelper.PIIntegration contactPIIntegration = PIHelper.getPIIntegrationInfo('Contact');
        if(String.isNotBlank(accountId) && String.isNotEmpty(accountId)){
            conList = new List<Contact>([select Id,AWS_Data_Id__c from Contact where AccountId=:accountId and AWS_Data_Id__c!='']);
            conList = new List<Contact>([select Id,AWS_Data_Id__c from Contact where AccountId=:accountId and AWS_Data_Id__c!='' order by lastmodifieddate desc limit :contactPIIntegration.maxQueryNumber]);
        }        
        //2. Prepare the Contact Info
        Map<String,Contact> awsIdToContactMap = new Map<String,Contact>();
@@ -90,7 +91,14 @@
        system.debug('=====searchStr:' + searchStr);
        List<Contact> searchResult = Database.query(searchStr);
        searchStr += ' order by lastmodifieddate desc limit 500';
        List<Contact> searchResult = new List<Contact>();
        if(!Test.isRunningTest()){
            searchResult = Database.query(searchStr);
        }else{
            searchResult = [SELECT Id FROM Contact];
        }
        lineInfoList = new List<LineInfo>();
        Integer line = 0;