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 Jul 26 '17 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? Jul 26 '17 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. Jul 26 '17 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? Jul 26 '17 at 10:58
  • prntscr.com/g0h4z6 : please check link. There is only one record is getting. Jul 26 '17 at 11:19

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.

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.