• Raghavendra Raj K S
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I need help.I'm trying query records from three objects which are releted and use on particular field in if().See below code Im getting error 
Error: Compile Error: Variable does not exist: Product2 at line 39 column 86..Please help.
Map<id,Quote> QuoteProductMap=new Map<Id,Quote>([Select id,recordTypeId,Status,(Selectid,Product2.Name,Product2.Additional_Spe__c FROM QuoteLineItems)from Quote where Id in:newItems.keyset()]);
 
          for(Quote quoteToProduct:newItems.values()){
if(QuoteProductMap.get(quoteToProduct.id).QuoteLineItems.Product2.Additional_Spe__c== listProductAttribute[0].Additional_spe__c)
                            {
                              quoteToProduct.sp_Products__c=true;
                               listQuoteProduct.add(quoteToProduct);       
                            }
}