
16 respuestas

Replace the above queries and try againAggregateResult[] shippingCounts = [SELECT Count(Id) c, OpportunityId FROM OpportunityLineItem WHERE OpportunityId in :ids and (pricebookEntry.product2.ProductCode = 'FedEx') GROUP BY OpportunityId];AggregateResult[] discountAmounts = [SELECT Count(Id) c, OpportunityId FROM OpportunityLineItem WHERE OpportunityId in :ids and (pricebookEntry.product2.ProductCode = 'DiscountAmount') GROUP BY OpportunityId];