Advertisement
Learnify_Rectify

Write SOQL Queries(5)

Jun 20th, 2024
3,285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | Source Code | 0 0
  1. Write SOQL Queries(5) from (module-Apex Basics & Database)
  2.  
  3. -------------------------------------------------
  4. The Apex class must be called ContactAndLeadSearch and be in the public scope :
  5.  
  6. SOURCE CODE:
  7. public class ContactAndLeadSearch {
  8.  
  9. public static list<list< sObject >> searchContactsAndLeads(String lastName){
  10.  
  11. list<list< sObject >> ContactLeadList = [ Find : lastName IN ALL FIELDS
  12. RETURNING contact(name),
  13. lead (Name) ];
  14. return ContactLeadList;
  15.   }   
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement