Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

How to create an apex class that returns contacts based on incoming parameters?

Asked by David Edwards Mar 1, 2023 1.5K views 1 answer
Share

About this question

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

Challenge not yet complete in venkat@gynanvruksh.com Executing the 'searchForContacts' method failed. Either the method does not exist, is not static, or does not return the expected contacts.

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.