Skip to main content
deleted 55 characters in body
Source Link
sanket kumar
  • 15.6k
  • 2
  • 29
  • 60
public class ContactSearch {
 
    public static list<contact> searchForContacts(string lastname,string MailingPostalCode)
    {
        
        list<contact>ContactList=[select id,name,lastname,mailingpostalcode from contact where lastname=:'lastname' and mailingpostalcode=:'MailingPostalcode'];
        
            return contactlist;


        
    }
}

error thrown====thrown====>

Challenge not yet complete in [email protected] Executing the 'searchForContacts' method failed. Either the method does not exist, is not static, or does not return the expected contacts.

Challenge not yet complete in [email protected] Executing the 'searchForContacts' method failed. Either the method does not exist, is not static, or does not return the expected contacts.

public class ContactSearch {
 
    public static list<contact> searchForContacts(string lastname,string MailingPostalCode)
    {
        
        list<contact>ContactList=[select id,name,lastname,mailingpostalcode from contact where lastname=:'lastname' and mailingpostalcode=:'MailingPostalcode'];
        
            return contactlist;


        
    }
}

error thrown====

Challenge not yet complete in [email protected] Executing the 'searchForContacts' method failed. Either the method does not exist, is not static, or does not return the expected contacts.

public class ContactSearch {
    public static list<contact> searchForContacts(string lastname,string MailingPostalCode)
    { 
        list<contact>ContactList=[select id,name,lastname,mailingpostalcode from contact where lastname=:'lastname' and mailingpostalcode=:'MailingPostalcode'];
        return contactlist;
    }
}

error thrown====>

Challenge not yet complete in [email protected] Executing the 'searchForContacts' method failed. Either the method does not exist, is not static, or does not return the expected contacts.

added 56 characters in body
Source Link
Santanu Boral
  • 36.2k
  • 8
  • 45
  • 72

public class ContactSearch {

public class ContactSearch {

    public static list<contact> searchForContacts(string lastname,string MailingPostalCode)
    {
        
        list<contact>ContactList=[select id,name,lastname,mailingpostalcode from contact where lastname=:'lastname' and mailingpostalcode=:'MailingPostalcode'];
        
            return contactlist; 


        
    }
}

} error error thrown==== Challenge

Challenge not yet complete in [email protected] Executing the 'searchForContacts' method failed. Either the method does not exist, is not static, or does not return the expected contacts.

public class ContactSearch {

public static list<contact> searchForContacts(string lastname,string MailingPostalCode)
{
    
    list<contact>ContactList=[select id,name,lastname,mailingpostalcode from contact where lastname=:'lastname' and mailingpostalcode=:'MailingPostalcode'];
    
        return contactlist;


    
}

} error thrown==== Challenge not yet complete in [email protected] Executing the 'searchForContacts' method failed. Either the method does not exist, is not static, or does not return the expected contacts.

public class ContactSearch {

    public static list<contact> searchForContacts(string lastname,string MailingPostalCode)
    {
        
        list<contact>ContactList=[select id,name,lastname,mailingpostalcode from contact where lastname=:'lastname' and mailingpostalcode=:'MailingPostalcode'];
        
            return contactlist; 


        
    }
}

error thrown====

Challenge not yet complete in [email protected] Executing the 'searchForContacts' method failed. Either the method does not exist, is not static, or does not return the expected contacts.

Source Link

trailhead module-----Create an Apex class that returns contacts based on incoming parameters

public class ContactSearch {

public static list<contact> searchForContacts(string lastname,string MailingPostalCode)
{
    
    list<contact>ContactList=[select id,name,lastname,mailingpostalcode from contact where lastname=:'lastname' and mailingpostalcode=:'MailingPostalcode'];
    
        return contactlist;


    
}

} error thrown==== Challenge not yet complete in [email protected] Executing the 'searchForContacts' method failed. Either the method does not exist, is not static, or does not return the expected contacts.