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
nununinununi 

Apex sharing is not executed by Customer Community users

Hello everyone,

I have apex based sharing rules setup as follows. When a user, creates a record in Object A, that record is shared with a public group based on a value in a look up field. 

Example:
If the record created looks up to master-record 1, it shares to public group 1
If the record created looks up to master-record 2, it shares to public group 2
and so on..

This works perfectly as long as the record is created by INTERNAL users.

Now I have a community setup with all my external users using the customer community login license type. When they create a record in the same object A, the above mentioned apex sharing code does not work. 

I have already checked the following:

  • They have the concerned apex classes enabled for their profiles
  • The apex classes are using ythe 'Without Sharing' keyword
Any help would be greatly appreciated!
SandhyaSandhya (Salesforce Developers) 
Hi,

After some research, i found that Apex sharing is not available for Customer Community users." on the following page

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.htm
 
and you should have Customer community plus license for this.

Please refer below posts for more information.

http://salesforce.stackexchange.com/questions/20894/sharing-access-to-partner-community-users-based-on-record-owner
 
http://salesforce.stackexchange.com/questions/127620/how-to-share-object-records-to-customer-community-users
 
Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution. 
 
Thanks and Regards
Sandhya