5

When I ran below query in workbench/developer console

SELECT product2 FROM OrderItem

am getting below error

No such column 'Product2' on entity 'OrderItem'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

But I see Product2 field in Order Product I am not sure why I am getting this error

enter image description here

7

There is no direct binding to the Product table from Order Lines, the link is actually through PricebookEntries. So the SOQL to get the ProductId would be:

select Pricebookentry.Product2Id from OrderItem

-1

Try doing:

SELECT product2id from OrderItem

We do not have orders enabled but this works for OpportunitLineItems which is its close cousin.

  • Same error message : No such column 'product2id' on entity 'OrderItem'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. – sfdc Mar 24 '15 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.