Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<String> personAccountsIDs = getPersonAccountsIDs(accountList);
- List<Contact> contactList = [Select ID,Name
- (Select Name,ID,Brand__c,Customer_Type__c from Profiles__r),
- (Select ID,Brand__c from Purchases__r)
- from Contact
- where AccountID in : personAccountsIDs];
- for(Contact c : contactList){
- Set<String> brandPurchased = new Set<String>();
- for(Purchase__c p : c.Purchases__r){
- if(p.Brand__c !=null)
- brandPurchased.add(p.Brand__c.toLowerCase());
- }
- ....
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement