Created
February 24, 2020 08:56
-
-
Save JodieM/c75155a7eab14b7f55b305b39e4c63da to your computer and use it in GitHub Desktop.
RWC Week 2 Homework SOSL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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