I have master-detail relationship between A-B object. A is master and B is child .

Now the requirement is , that A must be public and B must be private. what's the best way to implement this.


2 Answers 2


Your only option is changing the Master-Detail relationship to a lookup. In a Master-Detail relationships, according to the documentation:

The detail record inherits the sharing and security settings of its master record.

To retain the same features of a master detail you'll want to mark the lookup as required and and set it up to delete the child record when the parent is deleted.

  • Exactly. To add to this: You will notice that the child record in a master-detail relationship has no OwnerId field. Because visibility is controlled through the OwnerId field, it inherits the visibility of its parent record. Alternate solution: Make the M-D into a Lookup AND make the Lookup relationship REQUIRED. You can do this when editing the relationship field. Commented Aug 7, 2014 at 23:50
  • Also, if you need a cascade delete, use a trigger.
    – sfdcfox
    Commented Aug 7, 2014 at 23:53
  • 4
    Actually, cascade deletes are now an option on lookup fields.
    – greenstork
    Commented Aug 7, 2014 at 23:54
  • Thanks Everyone. @Greenshok..where i can mention the Cascade deletes for Lookup fields. Commented Aug 8, 2014 at 17:53

You will not be able to do this with a master-detail relationship. The detail records have the same visibility as the master. If the detail documents need their own separate permission settings, you'll need to switch to a lookup relationship.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .