0

I have a requirement to display a dynamic record list page to community members - so that based on the members profile (or user I’d or whatever) the record list shows only their records.

Members must log in. No public guests allowed. I’ve also prepared the page in my org so that each member’s record list page is filtered accordingly.

How can I tell community to vary the record list page based on the user.?

1
  • Please edit your post to include more detail - are you using Aura or Lightning Web Component or something else? Commented Sep 29, 2019 at 15:10

1 Answer 1

0

Get current user using below code in Apex

id userId = UserInfo.getUserId();

Based on above userId get currently logged communiy user's accountid

User user=[select id, UserName, FirstName, MiddleName, LastName, Name, accountId from User where id = : userId];

You can use that user.accountId to filter your query or record.

1
  • Thanks Dhanik. I’ll try this. Will pass the user’s contact id to the controller instead. Will let you know. Commented Oct 1, 2019 at 16:03

You must log in to answer this question.

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