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
nav anav a 

Does Account Share enabled directly in sharing rules??

If i want to share a record using apex.

we use Accountshare to share account records using apex.

Does accountshare automatically enabled?? how to enable it??what are the steps we need to follow
Mahesh DMahesh D
Hi Nav,

It will be automatically enabled and we don't need to do anything specific to enable it.

What is your actual requirement?

Regards,
Mahesh
nav anav a
I got a question in my recent interview that 

how will you share record using apex??
I told that using accountshare we can share account records.

Then interviewer asked me 
Do you know how to enable  Account Share??
I told it will be automatically enabled

but he again asked if it doesn't available how will you enable it?? 
I was little bit confused in concept and want to know is there any ways to enable/disable accountshare ??
 
Mahesh DMahesh D
Hi Nav,

I am sure there is no need of doing anything to enable it, I also spent some time and tried to get the information.
No place mentioned about enabling it. 

The object’s organization-wide default access level must not be set to the most permissive access level. For custom objects, this is Public Read/Write. For more information, see Access Levels. This object is used for creating Apex based sharing.

Here this is also not compulsory, in general we will make sure that it is not Public because if it is public then already sharing of data available to all users.

Please do let me know if it helps.

Regards,
Mahesh