Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. List<String> personAccountsIDs = getPersonAccountsIDs(accountList);
  2.  
  3. List<Contact> contactList = [Select ID,Name
  4. (Select Name,ID,Brand__c,Customer_Type__c from Profiles__r),
  5. (Select ID,Brand__c from Purchases__r)
  6. from Contact
  7. where AccountID in : personAccountsIDs];
  8.  
  9. for(Contact c : contactList){
  10.  
  11. Set<String> brandPurchased = new Set<String>();
  12. for(Purchase__c p : c.Purchases__r){
  13. if(p.Brand__c !=null)
  14. brandPurchased.add(p.Brand__c.toLowerCase());
  15. }
  16. ....
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement