Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. List<List<sObject>> searchList = [FIND 'Wingo OR SFDC' IN ALL FIELDS
  2. RETURNING Account(Name),Contact(FirstName,LastName,Department)];
  3. Account[] searchAccounts = (Account[])searchList[0];
  4. Contact[] searchContacts = (Contact[])searchList[1];
  5. System.debug('Found the following accounts.');
  6. for (Account a : searchAccounts) {
  7. System.debug(a.Name);
  8. }
  9. System.debug('Found the following contacts.');
  10. for (Contact c : searchContacts) {
  11. System.debug(c.LastName + ', ' + c.FirstName);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement