Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. set<Id> accIds = new set<Id>();
  2. for(Account acc : Trigger.new)
  3. {
  4. accIds.add(acc.id);
  5. }
  6. //query the contact records now from currently processed Account Ids
  7. List<Contact> lstContact = [select id from contact where Accountid in : accIds];
  8.  
  9. List<Contact> lstContact = [select id from contact where
  10. Accountid in : Trigger.newmap.Keyset()];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement