Guest User

Untitled

a guest
Nov 18th, 2017
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. List<Account> accts = [SELECT Id,Name,(SELECT Id,Email FROM Contacts) FROM Account];//all acount related contact information
  2. Contact con = [select id,Name,email from Contact where email='test@gmail.com' limit 1];//single salesforce Contact
  3.  
  4. for(Account a : accts){
  5. for(Contact c: a.contacts){
  6.  
  7. System.debug('All Email'+c.email);
  8. here i get the all accounts contact emails.
  9. Now how can i compare test@gmail.com with all account related contacts emails
  10.  
  11. }
  12.  
  13. }
Add Comment
Please, Sign In to add comment