Query –For Many to Many Relationship you need to create a Junction Object. The Junction Object has M-D relationship with both the Objects. For M-D relationship, the OWD setting is “Controlled by Parent”. If the two objects have different OWD then what will be the OWD setting for Junction Object? 

This question was asked in the trailblazer community and it had written ‘Great Question’ all over it.

This is a very common scenario which many admins ignore while creating a junction object because let’s admit it we sometimes tend to look at the security aspect of the object AFTER it gets created in the sandbox.

Junction object

However, I think security should always comes first whenever you are thinking of creating a new object or a new field. Questions like these should pop in the head whenever we start creating something –

What should be the owd setting for the object?

What users will be creating records for this object?

Which users should have just a read access or no access to the object/field?

Well, let’s get back to our problem statement.

The first master-detail relationship you create on your junction object becomes the primary relationship.
This affects the record ownership for the junction object records as the junction object records inherit the value of the Owner field from their associated primary master record. Because objects on the detail side of a relationship do not have a visible Owner field, this is only relevant if you later delete both master-detail relationships on your junction object.
The second master-detail relationship you create on your junction object becomes the secondary relationship. If you delete the primary master-detail relationship or convert it to a lookup relationship, the secondary master object becomes primary.

So, the Junction Object (Child) will inherit sharing settings from its primary Master, the one which was associated first to it.


Leave a Reply

Your email address will not be published. Required fields are marked *