Skip to content

Instantly share code, notes, and snippets.

@JodieM
Created February 24, 2020 08:56
Show Gist options
  • Save JodieM/c75155a7eab14b7f55b305b39e4c63da to your computer and use it in GitHub Desktop.
Save JodieM/c75155a7eab14b7f55b305b39e4c63da to your computer and use it in GitHub Desktop.
RWC Week 2 Homework SOSL
public class ContactAndLeadSearch {
Public Static List<List<sObject>> searchContactsAndLeads(String searchTerm){
List<List<sObject>> searchList = [FIND :searchTerm IN ALL FIELDS
RETURNING Contact(FirstName, LastName),Lead(FirstName,LastName)];
Contact[] searchContacts = (Contact[])searchList[0];
Lead[] searchLeads = (Lead[])searchList[1];
return searchList;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment