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
RaffiRaffi 

Parent-child relationship on OpportunitiesLineItems object

I want to create a child of OpportunitiyLineItem object, say OpportunityLineItemProfitSchedule but there is no option to create the neither master-detail nor lookup relationship to OpportunityLineItem object, i.e.. OpportunityLineItem object is not available in a drop down list of available objects. Is there a different way to set this up?
sfdcfoxsfdcfox

You can't link to these "sub-entities" directly. Case Comments, Opportunity Line Items, Quote Items, Account and Opportunity Contact Roles, Partners, and so on may not be parent records. You can still use a normal text field to store an ID, then use some triggers to simulate cascading deletes, and Visualforce pages to display the custom "relationships". Of course, this has some potential pitfalls, but if you're dedicated to the cause, you should have a decent chance of success.

rafkanrafkan

Hi, thanks for your response.
Enabling scheduled forecasting available out of the box in salesforce.com creates Product Schedule (OpportuntyLineItemSchedule) object which I presumed to be a child of OpportunityLineItem object, is this not the case? I am trying to extend the behaviour of Scheduled Revenue Forecasting to include Profit and cost which our sales department enters into opportunity, and generate Profit and Revenue based scheduled forecast reports our of that.

Thanks again,

sfdcfoxsfdcfox

It doesn't "create" the object, it merely exposes it to the users for consumption. For example, there's also an Order object that isn't normally accessible but can be turned on. Opportunity Products actually has a number of detail records in regards to opportunities, but these are all already in the system, not something created as a result of customization. You can't create arbitrary fields on these detail objects, as that's not what they're designed to do, nor can you create relationships to them in the same manner as you would a normal object. These are very specific standard objects designed with a specific purpose, and they are not subject to being retooled. There's a ton of customization you can do with the platform, but those objects are currently, as they always have been, offlimits to any extreme customization.

RaffiRaffi

Thanks for your explanation, it helps.