1

I'd like to give users the ability to attach files to the Opportunity Product sObject which doesn't inherently support file attachments.

How do I add that ability?

2
  • I'm not certain what you mean by "Opportunity Product sObject". Are you talking about either the Pricebook2 or perhaps the PricebookEntry sObjects? The Product and Schedule Objects diagram should help you clarify your question.
    – crmprogdev
    Commented Jun 25, 2015 at 16:00
  • The setup UI called is Opportunity Products (look in Opportunities). The object is actually called OpportunityLineItem,
    – sberley
    Commented Jun 25, 2015 at 22:18

1 Answer 1

1

OpportunityLineItem, or OLI as it's commonly referred to, is basically a reference in an Opportunity to a Product2Id that's listed in a Pricebook2 along with discounts and other things that have been applied to get the LineItem Total which is then summed to generate the Opp Amount. There's also info that affects Forcasting. The vast majority of what's in OLI is look-up info from other objects.

If you want to have attachments to OLI, I'd create a custom object that's a child of OLI. Whenever an OLI is deleted, I'd expect that you'd want to also delete the attachments as well. For that reason, I'd create a M-D relationship between OLI and the custom object where OLI is the master and the custom object is the detail.

That way, anything you want to attach to OLI, would be a child of OLI and would automatically be deleted with OLI and associated with the ID of an OLI record as opposed to being in a look-up relationship. That would be my recommendation if you feel you must have attachments to OLI as opposed attaching to the Opportunity instead (or possibly Pricebook2).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .