Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Account> accts = [SELECT Id,Name,(SELECT Id,Email FROM Contacts) FROM Account];//all acount related contact information
- Contact con = [select id,Name,email from Contact where email='test@gmail.com' limit 1];//single salesforce Contact
- for(Account a : accts){
- for(Contact c: a.contacts){
- System.debug('All Email'+c.email);
- here i get the all accounts contact emails.
- Now how can i compare test@gmail.com with all account related contacts emails
- }
- }
Add Comment
Please, Sign In to add comment