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
EtauEtau 

Is there a way to create a lookup relationship to opportunity products?

I have some fields in opp products that I need to populate to fields in the opportunity.  Is there a way to do this?

yudhvirmoryudhvirmor

As relation between Opportunity and Opportunity is 1:M, System will be confuse to pick data from which opportunity product line item.

Pradeep_NavatarPradeep_Navatar

Opportunity to opportunity product is ok but why do you want to populate data from opportunity product to opportunity? Can you explain the business logic or scenario? so that we can let you know the possible solution, if any.

SteveBowerSteveBower

For one project I created the concept of a "Primary" Opportunity Product Line record for each Opportunity.  Stored the Primary OLI Id in a lookup field on the Opportunity, and used formulas fields to pull the other fields from the OLI onto the Product.    I Created trigger code to maintain the Primary given the various things that could change to the OLI's.  The client had some other needs as well with regard to the primary including automatically selecting a Product as Primary if it was the only OLI for the Opportunity

 

The main business need for this was to for reporting on the Opportunity and Account.

 

So, perhaps you could approach it that way?

 

(But, as was said earlier, Opp to OLI is a 1:n relationship and so this approach only gives you data on one Product.)

 

Best, Steve.