Skip to content

Instantly share code, notes, and snippets.

@ganmahmud
Last active April 16, 2022 19:46
Show Gist options
  • Select an option

  • Save ganmahmud/90d45ce0852909eb2bd2208295d2b288 to your computer and use it in GitHub Desktop.

Select an option

Save ganmahmud/90d45ce0852909eb2bd2208295d2b288 to your computer and use it in GitHub Desktop.
Create an Apex class that returns contacts based on incoming parameters.
public class ContactSearch {
public static Contact[] searchForContacts(String lastName, String postCode){
Contact[] cts = [SELECT Contact.ID,Contact.Name FROM Contact
WHERE LastName = :lastName AND MailingPostalCode= :postCode];
return cts;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment