• Nandhini k 5
  • NEWBIE
  • 25 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
public class ContactSearch {

    public Static List<Contact> getSearchForContacts(String lastName,String mailingPostalCode)
    {
        List<Contact> myobj = [SELECT ID,LastName,MailingPostalCode FROM Contact WHERE LastName=:lastName AND MailingPostalCode=:mailingPostalCode];
       System.debug('.....:' +myobj);
        return myobj;
}
}

Sql editor
:SELECT ID, Name, MailingPostalCode FROM Contact WHERE LastName ='Davis'
Anonymous debug:
ContactSearch.getSearchForContacts('Young','66045');

 
public class ContactSearch {

    public Static List<Contact> getSearchForContacts(String lastName,String mailingPostalCode)
    {
        List<Contact> myobj = [SELECT ID,LastName,MailingPostalCode FROM Contact WHERE LastName=:lastName AND MailingPostalCode=:mailingPostalCode];
       System.debug('.....:' +myobj);
        return myobj;
}
}

Sql editor
:SELECT ID, Name, MailingPostalCode FROM Contact WHERE LastName ='Davis'
Anonymous debug:
ContactSearch.getSearchForContacts('Young','66045');