1

As a Customer Community User from account A, I want to see contacts that belong to account B Is the above possible?

I tried a Contact Sharing Rule without success and even a Manual Sharing (image attached, the one in red) on a Contact record and it also didn't work.

enter image description here

The weird thing is that I also created a Sharing Rule for Guest User (the one in green) and this works! As a Guest User, I can read all Customer Community Users (contact records) that belong to different Accounts.

Notes:

  • A Customer Community User is defined by a Contact record and a User record.
  • In my org my Community Users use the Customer Community licenses.
  • External User OWD for Contact is private.
  • I think Sharing Set is not a solution because it only works to share Contact data within the same Account
  • It is worth mentioning that Customer Community Users (Contact data) is displayed on an LWC, the component is feed by a method in an Apex Controller with a SOQL and it's using WITH SHARING.
  • The SOQL is not querying the Contact, but another CustomObject that has a lookup with Contact, the SOQL is filtering by Contact: SELECT x FROM CustomObject__c WHERE Contact__r.RecordType.Name = 'myContactRecod'
  • If I remove the WHERE part of the query above, I do get the results I expect !
  • Please change the description of your question? It says community users cannot see other community users which should be contact. Also add relevant code that you had in the comment to the question. – Mohith Shrivastava Apr 25 at 3:09
  • @MohithShrivastava I made the suggested changes. Thanks for the advice. – ratamaster Apr 25 at 3:48
  • Also list the license you use for community ? – Mohith Shrivastava Apr 25 at 4:05
  • @MohithShrivastava added, I just use Customer Community license for these users – ratamaster Apr 25 at 5:26
1

You won't be able to do this with Customer Community licenses. This type can't be assigned to Roles or public groups, so you can't apply sharing rules to these users. You'll need to use Customer Community Plus licenses if you want to apply sharing rules.

| improve this answer | |
  • Hi @DavidCheng, thanks for you answer. How come that as I said in my question, I do have read access with Guest User and I don't have read access with Customer Community license ? Isn't this a Salesforce issue ? I'm assuming that under no circumstance a Guest User could have more access than an Community User with the license Customer Community. Does this make sense ? – ratamaster Apr 26 at 2:34
  • Yes, with the recent guest user security update you can assign sharing rules to a Site / Community guest user, but unfortunately you cannot assign sharing rules to a Customer Community user for the reasons already given. – David Cheng Apr 26 at 18:36
0

I ended up with a work-around:

  • I created a formula field in the child object named ContactType__c, the formula displays the parent record type value.
  • I changed the query to this:List< CustomObject__c > myrecords = [SELECT ContactType__c FROM CustomObject__c]
  • The above query returns all the records, now I need to get the ones I'm interested with:
for(CustomObject__c o : myrecords){
   if(o.ContactType__c == 'x' || o.ContactType__c == 'r'){
      objs.add(o);
   }
}
  • It's worth mentioning that I tried to add the filter condition in the WHERE part of the query but it didn't work ! That's why I needed this for loop.

Thanks all for your help!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.