Product vs Product2
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
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.
apex
add a comment |Â
up vote
1
down vote
favorite
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.
apex
6
A long, long time ago, there was a Product object, along with a PriceBook object. However, it had some design flaws, and so salesforce.com retired it. However, because of their policy for backwards compatibility, they could not directly get rid of this object, nor was there a way to determine which behavior to invoke based on the name alone, so they introduced a new Product2 and Pricebook2. This allowed the old and new objects to coexist side by side. Today, we only use the *2 version of these objects.
â sfdcfox
Aug 22 at 11:09
@sfdcfox thanks for sharing. I don't think we can find it anywhere else.
â Tushar Sharma
Aug 22 at 11:20
@sfdcfox thanks for this helpful information.
â Jahnvi Jasani
Aug 22 at 11:23
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
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.
apex
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.
apex
edited Aug 23 at 5:19
asked Aug 22 at 10:52
Jahnvi Jasani
568
568
6
A long, long time ago, there was a Product object, along with a PriceBook object. However, it had some design flaws, and so salesforce.com retired it. However, because of their policy for backwards compatibility, they could not directly get rid of this object, nor was there a way to determine which behavior to invoke based on the name alone, so they introduced a new Product2 and Pricebook2. This allowed the old and new objects to coexist side by side. Today, we only use the *2 version of these objects.
â sfdcfox
Aug 22 at 11:09
@sfdcfox thanks for sharing. I don't think we can find it anywhere else.
â Tushar Sharma
Aug 22 at 11:20
@sfdcfox thanks for this helpful information.
â Jahnvi Jasani
Aug 22 at 11:23
add a comment |Â
6
A long, long time ago, there was a Product object, along with a PriceBook object. However, it had some design flaws, and so salesforce.com retired it. However, because of their policy for backwards compatibility, they could not directly get rid of this object, nor was there a way to determine which behavior to invoke based on the name alone, so they introduced a new Product2 and Pricebook2. This allowed the old and new objects to coexist side by side. Today, we only use the *2 version of these objects.
â sfdcfox
Aug 22 at 11:09
@sfdcfox thanks for sharing. I don't think we can find it anywhere else.
â Tushar Sharma
Aug 22 at 11:20
@sfdcfox thanks for this helpful information.
â Jahnvi Jasani
Aug 22 at 11:23
6
6
A long, long time ago, there was a Product object, along with a PriceBook object. However, it had some design flaws, and so salesforce.com retired it. However, because of their policy for backwards compatibility, they could not directly get rid of this object, nor was there a way to determine which behavior to invoke based on the name alone, so they introduced a new Product2 and Pricebook2. This allowed the old and new objects to coexist side by side. Today, we only use the *2 version of these objects.
â sfdcfox
Aug 22 at 11:09
A long, long time ago, there was a Product object, along with a PriceBook object. However, it had some design flaws, and so salesforce.com retired it. However, because of their policy for backwards compatibility, they could not directly get rid of this object, nor was there a way to determine which behavior to invoke based on the name alone, so they introduced a new Product2 and Pricebook2. This allowed the old and new objects to coexist side by side. Today, we only use the *2 version of these objects.
â sfdcfox
Aug 22 at 11:09
@sfdcfox thanks for sharing. I don't think we can find it anywhere else.
â Tushar Sharma
Aug 22 at 11:20
@sfdcfox thanks for sharing. I don't think we can find it anywhere else.
â Tushar Sharma
Aug 22 at 11:20
@sfdcfox thanks for this helpful information.
â Jahnvi Jasani
Aug 22 at 11:23
@sfdcfox thanks for this helpful information.
â Jahnvi Jasani
Aug 22 at 11:23
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
Products are represented by Product2 objects. As of API version 8.0,
the Product object is no longer available. Requests containing Product
are refused, and responses do not contain the Product object.
So You need to use Product2 in your query but the label is Product.
Product2
Represents a product that your org sells. This object has several fields that are used only for quantity and revenue schedules (for example, annuities).
Products are the items and services that you sell to customers. Each product can exist in multiple price books with different prices.
Reference:-
Product object
add a comment |Â
up vote
2
down vote
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
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
Products are represented by Product2 objects. As of API version 8.0,
the Product object is no longer available. Requests containing Product
are refused, and responses do not contain the Product object.
So You need to use Product2 in your query but the label is Product.
Product2
Represents a product that your org sells. This object has several fields that are used only for quantity and revenue schedules (for example, annuities).
Products are the items and services that you sell to customers. Each product can exist in multiple price books with different prices.
Reference:-
Product object
add a comment |Â
up vote
5
down vote
accepted
Products are represented by Product2 objects. As of API version 8.0,
the Product object is no longer available. Requests containing Product
are refused, and responses do not contain the Product object.
So You need to use Product2 in your query but the label is Product.
Product2
Represents a product that your org sells. This object has several fields that are used only for quantity and revenue schedules (for example, annuities).
Products are the items and services that you sell to customers. Each product can exist in multiple price books with different prices.
Reference:-
Product object
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
Products are represented by Product2 objects. As of API version 8.0,
the Product object is no longer available. Requests containing Product
are refused, and responses do not contain the Product object.
So You need to use Product2 in your query but the label is Product.
Product2
Represents a product that your org sells. This object has several fields that are used only for quantity and revenue schedules (for example, annuities).
Products are the items and services that you sell to customers. Each product can exist in multiple price books with different prices.
Reference:-
Product object
Products are represented by Product2 objects. As of API version 8.0,
the Product object is no longer available. Requests containing Product
are refused, and responses do not contain the Product object.
So You need to use Product2 in your query but the label is Product.
Product2
Represents a product that your org sells. This object has several fields that are used only for quantity and revenue schedules (for example, annuities).
Products are the items and services that you sell to customers. Each product can exist in multiple price books with different prices.
Reference:-
Product object
edited Aug 22 at 11:06
answered Aug 22 at 11:01
sanket kumar
1,357117
1,357117
add a comment |Â
add a comment |Â
up vote
2
down vote
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
add a comment |Â
up vote
2
down vote
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
add a comment |Â
up vote
2
down vote
up vote
2
down vote
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
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
answered Aug 22 at 10:58
Tushar Sharma
23.3k52044
23.3k52044
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f229719%2fproduct-vs-product2%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
6
A long, long time ago, there was a Product object, along with a PriceBook object. However, it had some design flaws, and so salesforce.com retired it. However, because of their policy for backwards compatibility, they could not directly get rid of this object, nor was there a way to determine which behavior to invoke based on the name alone, so they introduced a new Product2 and Pricebook2. This allowed the old and new objects to coexist side by side. Today, we only use the *2 version of these objects.
â sfdcfox
Aug 22 at 11:09
@sfdcfox thanks for sharing. I don't think we can find it anywhere else.
â Tushar Sharma
Aug 22 at 11:20
@sfdcfox thanks for this helpful information.
â Jahnvi Jasani
Aug 22 at 11:23