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

Sharing a record using Apex



I have portal users working in same account but department is different. Iwant to restrict one department user to see other department user cases. 


My account object is bind with accountdetail(department)  object with master-detail relationship. As the number of user are too much I cannot apply role criteria for them. Is there any way I can achieve the same using apex sharing rule?


Please guide.