You need to sign in to do that
Don't have an account?
vikas rathi91
Not able to get the value from map. I am put the value in map using aggregate list.
Hi ,
I am put the value in map using the Aggregate list but not abel to get the value from map.
I am not able to find any solution .
Can any one corret me.
Thanks in advance.
I am put the value in map using the Aggregate list but not abel to get the value from map.
Map<Id,List<Id>> BdrepMap = new Map<id,list<id>>(); List<AggregateResult> opp_line_item_list = [Select OpportunityId, Product_BD_Rep__c, SUM(UnitPrice) FROM OpportunityLineItem WHERE opportunityId IN : oppMap.keyset() GROUP By Product_BD_Rep__c, OpportunityId]; for(AggregateResult oli : opp_line_item_list){ BdrepMap.put((ID)oli.get('opportunityId'),New list<id>()); BdrepMap.get((ID)oli.get('opportunityId')).add((ID)oli.get('Product_BD_Rep__c')); } //oppteamlist its another list for(opportunityTeamMember team : oppteamlist){ if(team.UserId != oppMap.get(team.OpportunityId).OwnerId && team.UserId == BdrepMap.get(team.OpportunityId).Product_BD_Rep__c){ deleteOppTeam.add(team); } } // error is Variable does not exist: Product_BD_Rep__c
I am not able to find any solution .
Can any one corret me.
Thanks in advance.
WIll return the BdrepMap.get(team.OpportunityId) the LIST
BdrepMap.get(team.OpportunityId) will return list of id's . You cannot query a field from it.
Rather if you have only one 'Product_BD_Rep__c' for an opportunity then you can use Map<id,Opportunity> and can extract values as you did before : BdrepMap.get(team.OpportunityId).Product_BD_Rep__c value .
Thanks.