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
Nico-ITWNico-ITW 

Lookup information from fields from another table

I've added a custom field to Product; 'Purchase Price'
When creating an Opportunity and adding products, I would like to see this Purchase Price with the products. (this so I can calculate Sales Price -/- Purchase price = Revenue)

But how can I add a field to 'Opportunity Products' that looks up the Purchase Price from Products?
I've tried a formula field with syntax Product.PurchasePrice, but I keep getting the error 'Field Product does not exist'.

What am I doing wrong?

jvolkovjvolkov

I am not sure if this will work between Opportunities and Products, but you may be able to establish a Master-Detail relationship between the two that would enable you to create rollup summary fields in the Opportunity object based on information from the Products object.

Master-Detail relationships do have their drawbacks though.  I would recommend reading up on the subject.

rpr2rpr2

You need to add your custom field to Opportunity - Product.  You can find this under Opportunity in Setup. 

Also, add the field to the Opprtunity Product page layout, and notice that there are two places you can do this -- on the page layout as for all other objects types, and also using the Edit Multi-Line Layout button.

Rhonda