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
Praveen P 32Praveen P 32 

how to restrict user to view certain amount of records out of all records?(lets say 50 records out of 100 rec)

NagendraNagendra (Salesforce Developers) 

Hi Praveen,

The OWD establishes the baseline default access for the object. If one (or all three) of the objects is set to 'Public Read/Write' then that means all Users can view and edit all records for that object, regardless of whether they are the record Owner or not.

The role hierarchy overrides the OWD sharing setting (to some extent) by granting access to those Users above the record Owner in the role hierarchy.

What you would need to do to accomplish this is change the OWD for the object(s) to Private, which would allow only the record Owner and those Users above them in the role hierarchy to see the record by default, and then you can either extend access using sharing rules for those Users that need to see all records for an object, or you can grant the Users' Profiles 'View All' access on the object(s) in question.

Let me know if I can help with anything.

For more information please check below link.

Hope this will help you.

Kindly mark this as solved if the information was helpful.