You need to sign in to do that
Don't have an account?
Sunil_sfcd803
Fetch map values of related objects into if()?
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.
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); } }
Space is missing between id,product2
Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.
Thanks
Varaprasad
@For Support: varaprasad4sfdc@gmail.com
Check the below code this might be helpful.