Alejandro De Gregorio
Alejandro De Gregorio

Reputation: 35

Salesforce - Can a junction object be referenced as a parent of other object with master-detail relationship?

I have a junction object, "Purchase", with two master-detail relationships. One with Customer and another with Product. Now I need to add a master-detail relationship in Payment object with Purchase as a parent.

The problem is that when I try to create a new master-detail relationship the Purchase object is not available to select as a parent. I can do a Lookup relationship but not a master-detail.

Anyone know if there is a way of doing that or if there is a Salesforce limitation on that?

Upvotes: 2

Views: 2731

Answers (1)

John Sullivan
John Sullivan

Reputation: 1311

This is a Salesforce limitation. Unless an object is a master in all of its master-detail relationships, it can only participate in two master-detail relationships. In your case, you can get around this issue by converting any one of the three relationships on Purchase to a lookup relationship. Fortunately, new features in the Summer 12 release allow you to set lookup relationships as required and to perform cascading deletes on required lookups. If you were to set up on of the lookups in that way, the main piece of functionality that you would lose would be the ability to create roll-up summary fields on whichever object is no longer as master.

Upvotes: 2

Related Questions