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
Puneet SardanaPuneet Sardana 

A security requirement

Hi All,


I am trying to enforce some security in some objects. What I am trying to do is this. I have two records A and B with master detail relationship with A being the master. Now I want users to see all information of A except for some secure fields. This I have achieved through field level security. Next in detail object I have a checkbox which denotes that this record is secure and should be shown to some users only. How can I implement this using Salesforce default functionality or is there any other solution as well? Also, I would like to hide events/tasks from users.






Hi Puneet,


You may put the child object in private sharing model.
Create a public group with all the people who can see the records with the check box.
Create a criteria based sharing rule on the Child Object to share records to the Group to the records based on the Criteria.
Path: Setup| Security Controls | Sharing Settings | <Child Object Name> | New | Under
Step 2: Select your rule type select | Based on criteria | follow the wizard |
See the link for more information :




Puneet SardanaPuneet Sardana

Hi Ashish,


The relationship between them is Master Detail in which access to child depends on Parent. Hence this will not work. Do you have any other solution?





@Puneet - As rightly pointed by you the visibility for the child is now driven by the parent and hence cannot be restricted. You will either have to review your requirements to change the relationship to a lookup and follow @Ashish_SFDC or hide the default related list for the child and use a inline VF page to control the visibility, which is then used as a related list in your detail page. This is the only viable option that I can think of.
Puneet SardanaPuneet Sardana
Hi vbs,

I guess that's a potential fallout of Salesforce security features. In case anyone has any other solution, please let me know.