• Mona Verma 2
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
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



 
Hi All,
I am struggling to find best way to create a lightning component which lists Accounts as well as Person Account records created within a time range ordered by distance from a certain location (lat/lng) along with pagination.

I already have a working components which lists all accounts created within time specified ordered by distance with Offset value for 10 records each time. But now to include all Person accounts in that list with ordering to work together on (Account+Person Accounts), is it possible to achieve with one query?