function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
maz00maz00 

Product vs. Product2

Hi,

When you store assigned products to opportunities (using Product) in OpportunityLineItem where do you store them for Product2?

Thanks
Maz.

ScotScot

An opportunity line item is linked to either:
    > the old-style Product, through the ProductId field, or
    > the new-style PricebookEntry, through the ProcebookEntryId field

When using the new approach, the product is determined by looking it up in the PricebookEntry.

Unless you have to maintain (complex) existing code using the old Product table, I'd stronly suggest that you use the PricebookEntry approach and ignore the ProductId field in the OpportunityLineItem table.

Scot