Advertisement
Learnify_Rectify

Write SOQL Queries(4)

Jun 20th, 2024
2,697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | Source Code | 0 0
  1. Write SOQL Queries(4) from (module-Apex Basics & Database)
  2.  
  3.  
  4. -------------------------------------------------
  5. The Apex class must be called ContactSearch and be in the public scope :
  6.  
  7.  
  8. SOURCE CODE:
  9. public class ContactSearch {
  10. public static List<Contact> searchForContacts(String lastName, String maillingpostalCode){
  11. List<Contact> contactList = [Select Id,Name from Contact where
  12. LastName =: lastName and
  13. MailingPostalCode =: maillingpostalCode];
  14. return contactList;
  15.     }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement