• OU VISAL
  • NEWBIE
  • 0 Points
  • Member since 2014
  • System Administrator

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hello,

I alway get error "Challenge not yet complete... here's what's wrong: 
Executing the 'searchForContacts' method failed. Either the method does not exist, is not static, or does not return the expected contacts."

I have my code as following:
public class ContactSearch {
    public List<Contact> searchForContacts (String cName, String pCode) {
        
        List<Contact> matchCon = [SELECT Id, First_Name__c, Last_Name__c, MailingPostalCode__c FROM Contact
                                  WHERE Last_Name__c = 'cName'
                                  AND MailingPostalCode__c = 'pCode']; 
        
        if(matchCon.size() > 0){
            return matchCon;
        } else {
            return null;
        }
    }
}

Kindy check and tell me what is wrong

thank in advance

Visal
Hello,

I alway get error "Challenge not yet complete... here's what's wrong: 
Executing the 'searchForContacts' method failed. Either the method does not exist, is not static, or does not return the expected contacts."

I have my code as following:
public class ContactSearch {
    public List<Contact> searchForContacts (String cName, String pCode) {
        
        List<Contact> matchCon = [SELECT Id, First_Name__c, Last_Name__c, MailingPostalCode__c FROM Contact
                                  WHERE Last_Name__c = 'cName'
                                  AND MailingPostalCode__c = 'pCode']; 
        
        if(matchCon.size() > 0){
            return matchCon;
        } else {
            return null;
        }
    }
}

Kindy check and tell me what is wrong

thank in advance

Visal