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
pradeep kumar s 1pradeep kumar s 1 

Creating a PageBlockTable for Parent to Child Relationship.

hello friends,
i have done a pageblocktable with parent to child relationship. here is a problem i can see the whole records on my profile (system admin) but another user can not see these records with the same pageblock table.i have given field level security,profile permissions on those objects also.
still why can not he see those records?please mention me any permissions on those reocrds.
Best Answer chosen by pradeep kumar s 1
jigarshahjigarshah
Pradeep,

When the code executes with System Admin permissions, the respective User generally has the View All permissions set at Profile level which because of him being the super user for the Salesforce org. This enables all the user with that particular profile to be able to view those records.

When you run the same controller code with a different user, the page controller would have with sharing keyword set before the class keywod. This means the code runs in the user mode and repsects the Record level access granted to the respective user account executing the Visualforce page, which is controlled using Roles within Salesforce.

Roles provide different ways or methods which help open up access to those records such as Org Wide Defaults, Sharing rules, Manual Sharing, Apex Sharing, Role Hierarchy.

Here are a few things you can do to open up access
1. Provide the Non System Admin User with View All access. This is not recommended.
2. Share the appropriate object records with the Non System Admin User using Sharing Rules, Manual Sharing or Role Hierarchy.

Please do not forget to mark this thread as SOLVED if this answer helps resolve your issue.

All Answers

jigarshahjigarshah
Pradeep,

When the code executes with System Admin permissions, the respective User generally has the View All permissions set at Profile level which because of him being the super user for the Salesforce org. This enables all the user with that particular profile to be able to view those records.

When you run the same controller code with a different user, the page controller would have with sharing keyword set before the class keywod. This means the code runs in the user mode and repsects the Record level access granted to the respective user account executing the Visualforce page, which is controlled using Roles within Salesforce.

Roles provide different ways or methods which help open up access to those records such as Org Wide Defaults, Sharing rules, Manual Sharing, Apex Sharing, Role Hierarchy.

Here are a few things you can do to open up access
1. Provide the Non System Admin User with View All access. This is not recommended.
2. Share the appropriate object records with the Non System Admin User using Sharing Rules, Manual Sharing or Role Hierarchy.

Please do not forget to mark this thread as SOLVED if this answer helps resolve your issue.
This was selected as the best answer
pradeep kumar s 1pradeep kumar s 1
thanks jigarshah for your reply.it is helpful.