Security control

About Apex Sharing Reason

Apex sharing reason is used to identify, why the record are shared with the user. If a developer is doing any operation on that record sharing then he can able identify in which sharing records he needs to do the operation. Its especially for managing a record sharing through apex code.Lets go through this with some example.

Records level access:

Sharing a record through Apex code

In Force.com platform there are different level to control the access of the data. In this blog I will explain you how extend the records access(Sharing the record) to users or group through apex code.

1. Create an object called 'Expense' with all the default settings.

2. Create a custom object tab for Expense object.

3. Make the 'Expense' object as private in the security control under the setup area.