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?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
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).