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
kdmrkdmr 

Master-Detail relationship with Product

Hi,

 

I am i have a created a custom object and am trying to make a master-detail relationship with the object Product. The problem is when I select Master-Detail the Product object does not show up in the drop down list. Does this mean that I can not create a Master Detail relation ship keeping the Product as the master or is there some settings to be changed to get this done.

 

Thanks

KD 

Build RealtyBuild Realty

Did anyone ever contact you with this answer?  I am having the same issue right now and cannot find a solution.  Thanks

 

miteshsuramiteshsura

I am sailing in the same boat, please post any pointers you received.. thanks

ChrisNoeChrisNoe

Same issue here.  Any updates?

DownstairsBDownstairsB

I've encountered the same issue.  Of course this was after I had already set up the child object. (in my case it's "Product Lot" which is like a batch of products with date & quantity details... obviously we want a total quantity on the Product... ) 

 

Looks like I will have to just use a regular lookup, and write a couple Apex triggers to handle the "roll-up summary" fields.  Not a very elegant solution in my opinion.

jygjyg

I've love to know why a Product2 cannot be a master.

miteshsuramiteshsura

I wish we knew, when i was researching I did not find anything solid, just a SF documentation that said Product2 object cannot be the master. 

If I remember correectly, I did call SF support , but they did not have any reason too. 

 

I ended up creating new custom object. 

KD119KD119

I have read that any object can have only upto 2 Master-Child relationship, and my guess is that Product2 object already has 2 Master Child relationship.... I may be wrong and there could be some other reason.

miteshsuramiteshsura

KD119,

 

Well you are right on that any object can have atmost 2 masters. I do not see master child relationship on Product2 object itself. Are you referring to PricebookEnter object?

Also if an object has 2 master child relastionhip, it itself can be a master for some other object, master-child is always defined on the child object. 

 

I think Product2 and few others are just exception for master-child, I may be wrong too, but so far I found nothing. 


KD119 wrote:

I have read that any object can have only upto 2 Master-Child relationship, and my guess is that Product2 object already has 2 Master Child relationship.... I may be wrong and there could be some other reason.


 

Burton024Burton024

I have the same problem and am creating a new custom object too.

jygjyg

Being that the Product  object's API name is "Product2", it sounds like at least one mistake is already being bandaged over.  I would bet this Master-Detail is part of the same.

taylorataylora

Also having same problem as we're expanding fuctionality of an existing system. Wish I could create custom object and start from fresh, but worried it mess with all the existing data. Going to go the look-up route. Is there someone from Salesforce.com who can explain why this exists this way?

taylorataylora

Also having same problem as we're expanding functionality of an existing system. Wish I could create custom object and start from fresh, but worried it mess with all the existing data. Going to go the look-up route. Is there someone from Salesforce.com who can explain why this exists this way?

DanielJimenezDanielJimenez
So has anyone gone and built a trigger to work around this? If so do you mind sharing the trigger and any test code? If SalesForce won't fix it, at least maybe we can all save some time sharing the work arounds. Thanks in advance! If I end up writing one I'll be sure to post back. Daniel
cnoe26cnoe26

I don't think there is a limit of 2 on the number of times an object can be the master.  Our Campaign object is the master to 9 custom objects.

 

Chris

Mitesh SuraMitesh Sura

cnoe26, you can have atmost 2 master detail relationship for a child object. I do not think there is a upper limit on an object that can be a Master object. 

 

regards

SF Partner

Caalap@2012Caalap@2012

I am stucked up on the same point. I have raised query to Salesforce. Hope will get some positive feedback.

Dreamforcin FoolDreamforcin Fool

Ditto.  Having the same issue.  Any ideas?

SpadeLIvesSpadeLIves

I ended up dropping Force.com and redeveloping on another platform.

Peter_sfdcPeter_sfdc

When a question comes up like this a good follow up question is "why?" 

 

In this case why do you want product to be the master in a master detail relationship? 

 

M-D Relationships have several factors to consider:

1. They are always required.

2. The force inheritance of record access and sharing model from parent to child

3. By default they are not updatable (but as of Summer 12 can be) 

4. They cascade deletes

5. They allow an admin/developer to use roll-up summary fields

 

All of these have work-arounds if you are compelled to use a lookup relationship. So which of these is standing in your way? 

SpadeLIvesSpadeLIves

The issue is the ability of the framework (or lack of ability in this case) to support inheritance. A Master-Detail relationship is fundamentally an inheritance model that indicates the detail "is a" detail of the master. Since an object can have many lookup relationships, this is instead a "has a" relationship with respect to the lookup object, which means that you cannot model true inheritance. Although it may be possible to "work around" this massive limitation as you suggest, all such efforts are ultimately hacks..

 

From a practical perspective, it is unbelievably unwieldy to try to join objects into a single entity programmatically and the work-around strategy breaks down completely if you try to model multiple layers of inheritance such as vehicle->land vehicle->passenger vehicle->suv.

 

Faith TennysonFaith Tennyson
What functionality is lost when using a Custom Object instead of the standard object (Products)?
Nicole GreczynNicole Greczyn
Check out this thread with the change in process toward the bottom that allows you to create a relationship with Products to a custom object. https://success.salesforce.com/answers?id=90630000000gq1BAAQ   Start with master-detail and add a lookup to your custom object. This works for our purposes which is to reference products on our custom object without a lot of extra manual entry, but allow products sold to live with opportunitites as they should.
Kalanithi BalasubramanianKalanithi Balasubramanian
Any help on this!