function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lizeth SánchezLizeth Sánchez 

which is my mistake?

public class ContactSearch {
    public List<Contact> searchForContacts(String contactName, String contactPostCode) {
        List<Contact> contacts = [SELECT Name 
                                  FROM Contact 
                                  WHERE Name=:contactName 
                                  OR MailingPostalCode=:contactPostCode];
        return contacts;
    }
}User-added image
Shun KosakaShun Kosaka
Add static ​keyword to this method!
public static List<Contact> searchForContacts(String contactName, String contactPostCode)