6

In trying to use a query based on product standard object in a Batch Apex program.

select name from product/products returns error even in Developer console.

Errors :

sObject type 'Product' is not supported.

select name from products ^ ERROR at Row:1:Column:18

sObject type 'products' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

Please advice.

Thanks all. Yes Product2 query is working.

  • If your question is answered, you can press the checkmark in order to mark an answer as "correct". This will, not only give you and the other person points, but it'll help others find answers. – House- 'Reinstate Monica' -man Jun 17 '15 at 15:36
5

The product object is actually called 'Product2'.

From the documentation

Products are represented by Product2 objects. The Product object is no longer available.

Try changing your SOQL to something like below

list<Product2> products = [Select Id, Name From Product2];
0

Ninja is right product object is no more available in salesforce now its product2. so you have to query like this [Select Id,Name from Product2 Where Product2.Name !='null'];

for more information check this link http://www.infallibletechie.com/2013/08/how-to-query-product-object-in.html

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.