• Freedom Evans
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I'm trying to query for Product and their related opportunity products using the follow soql 

SELECT Id,Name,(SELECT Id FROM OpportunityLineItem) FROM Product2.  

However I get  this error message anytime I execute the code. 

Didn't understand relationship 'OpportunityLineItem' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

Schema show they are related in salesforce but I don't know why this query isnt working. 
I'm trying to query for Product and their related opportunity products using the follow soql 

SELECT Id,Name,(SELECT Id FROM OpportunityLineItem) FROM Product2.  

However I get  this error message anytime I execute the code. 

Didn't understand relationship 'OpportunityLineItem' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

Schema show they are related in salesforce but I don't know why this query isnt working.