You need to sign in to do that
Don't have an account?
sheila srivatsav
Ma<ID,List<Opportunities>> concept
I have a list of opportunities inside a list as follows
List<Opportunities> opporList= new List<Opportunities>([select ID,Name,Amount from Opportuntities)];
Now I have the following : Map<ID,Account> accMap=new Map<ID,Account>();
Now I wanto to seggregate accountID and productiD from the list.
List<Opportunities> opporList= new List<Opportunities>([select ID,Name,Amount from Opportuntities)];
Now I have the following : Map<ID,Account> accMap=new Map<ID,Account>();
Now I wanto to seggregate accountID and productiD from the list.
Refer the below code.
List<Opportunity> opps = new list<Opportunity>([Select Id,AccountId, (Select Id, name From OpportunityLineItems) From Opportunity]);
//now you can seggrigate the both Account and Product2Id Like this
ste<Id> setid=new set<Id>();
for(opportunity opp:opps)
{
setid.add(opp.AccountId);
} // get your Product2Id as well
Mark it as a best if it helps you.
Thanks,
Ajay Dubedi