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
Mona Verma 2Mona Verma 2 

Permissions for guest user profile to access Person account related list

Hi, 
In my org, I have business account for Law firms and also Person accounts for Individual Lawyers. There is many-to-many relationship between these Law firms and Subjects in which they Specialize using Junction object specializations__c . The similar relatioship using junction object specializations__c also exists between Individual lawyers and subjects.
Now when I do SOQL query to fetch specializations__c related to a Law firm on lightning component used on Customer Community, It returns the list but when I use same query for Person account, it returns empty list. 
SOQL - select Subjects__r.Name from specializations__c where Account = :accountId
(Don't focus on syntax of query)

My observations - 
1. Guest user has access to all 3 objects involved Accounts, specializations__c (junction), Subjects because it works properly for Business account. 
2. Query syntax is correct because it works on query editor for both Business accounts and Person Account, gives desired result.
3. Problem is only for External User(Guest User) because when I preview my community portal on builder, it returns the result for Person account and works fine but when I access same community as Guest user then it gets empty list [ ].
4. As per this arcticle Enable 'Person Accounts' for 'Guest User Profile' in Site.com (https://help.salesforce.com/articleView?id=000334554&type=1&mode=1), I have Read access on Guest user profile for both Account and Contact object. 

I only suspect I am missing some important permission due to which I am not able to fetch the related list of Person Account in my lightning controller using Guest user profile.

Please suggest what is the permission which might be restricting this.
Thanks in advance.

Regards,
Mona



 
ShirishaShirisha (Salesforce Developers) 
Hi Mona,

Greetings!

Can you please confirm,if you have read Access for the Object Subject__c on which you are trying to query.Also,please check if you have FLS for the Name field on the Guest user profile to confirm that you have read Access.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri