Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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.

share|improve this question
    

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.

share|improve this answer
    
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. –  DavidSchach Aug 7 at 23:50
    
Also, if you need a cascade delete, use a trigger. –  sfdcfox Aug 7 at 23:53
2  
Actually, cascade deletes are now an option on lookup fields. –  greenstork Aug 7 at 23:54
    
Thanks Everyone. @Greenshok..where i can mention the Cascade deletes for Lookup fields. –  Ankit Khandelwal Aug 8 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.