Explain the difference - product vs product2.
I want to upsert a Product record using Apex.
When I write:
Product pr = new Product();
It gives an error "Invalid Type: Product".
but when I write
Product2 pr = new Product2();
Then no error occurs. Can anyone please explain the reason behind this.
Products is the label while Product2 is the API name. In apex we use API name that's why you have to use Product2 to create a new instance. Product object is no longer available after API version 8.
Product2