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
cleverlemmingcleverlemming 

either-or custom object to parent relationship

Howdy,

 

I have the following three custom objects: business_entity_type_A, business_entity_type_B, and property. Either type of business entity can own property but any one property can only be owned by one business entity. Business entities can own multiple properties. Thus Property can be a child of either type of business entity but not both. How do I model this using Master-Detail relationships?

 

Thanks in advance!

goabhigogoabhigo

May not be possible with Master-Detail relationship, as it makes parent mandatory in child. Instead of master-detail, you can use Lookup. Use a validation rule to check whether both fields(lookups) are filled. If you are using M-D for specific reason - roll-up in parent, then with lookup it is not possible, you will have to write a trigger for that.

 

Let me know if you need clarification.

cleverlemmingcleverlemming

abhi_the1 wrote:

Instead of master-detail, you can use Lookup.


I'll try this--thank you for your prompt and helpful reply!

SharathChandraSharathChandra

You Can create a junction object with three look up fields

Bussiness entity A

Bussiness entity B

Property

All are lookup fields