In my org, we have 5 contact matching 'dummy record'. When we use SOQL in community pages. It shows only one records.

Sharing setting

  • Contact : Controlled by Parent
  • Account : Public read/write


If we access directly from URL contact id, its get access. But can't query that record in custom visualforce page. The controller has a keyword with sharing.

Did I am missing something?

  • Let me know if any queries , i will answer Commented Jul 26, 2017 at 8:29
  • Does the profile have the view all permission on account? The contact records that you are unable to see through query, are they created by some other user rather than the currently logged in user? Commented Jul 26, 2017 at 10:45
  • Yes, the current login user has permission of view all. Yes that record(not-found) are created by admin. Not by current login. Commented Jul 26, 2017 at 10:54
  • One more thing, do the contacts that are not being shown in the query have a parent account associated? Also, can you please share sample code? Commented Jul 26, 2017 at 10:58
  • prntscr.com/g0h4z6 : please check link. There is only one record is getting. Commented Jul 26, 2017 at 11:19

2 Answers 2


If Community user is a Contact of an account then he/she can see other contacts of the Same account.

That can be queried through SOQL or UI.

Refer: Built-in Sharing Behavior

Sharing behavior for portal users

  • Account and case access—An account’s portal user has Read Only access to the parent account and to all of the account’s contacts.
  • Management access to data owned by Service Cloud portal users—Since Service Cloud portal users don't have roles, portal account owners can't access their data via the role hierarchy. To grant them access to this data, you can add account owners to the portal’s share group where the Service Cloud portal users are working. This step provides access to all data owned by Service Cloud portal users in that portal.
  • Case access—If a portal user is a contact on a case, then the user has Read Only access on the case.

This what I did to solve the issue.

  1. Go to Gear icon | Setup | Feature Settings | Digital Experience | Settings.
  2. Select Allow users to see contacts that have not been enabled for partner or customer accounts
  3. Click Save.

Documentaion can be found here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .