Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Map<ID,Opportunity[]> oppsByAccount = New Map<ID,Opportunity[]>();
- for(Opportunity o : [Select AccountID, (Select Pricebookentry.product2.ProductFamily From Opportunity Line Item) From Opportunity Where AccountID IN :THESET]){
- Opportunity[] tmp = oppsByAccount.get(o.AccountID);
- if(tmp == null){
- oppsByAccount.put(o.AccountID,New Opportunity[]{o});
- }else{
- oppsByAccount.get(o.AccountID).add(o);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement