I've seen versions of this question — but no workable answer. So trying again. Need to know what parameters will work to pull up logged-in user's Account Detail. This should not be complicated!

enter image description here

Using the OOB Navigation Menu

  • Edit Navigation Menu to add menu item
  • type = Community Page
  • Page = Account Detail
  • URL defaults to /account/:recordId

the last required item is the URL, and the default is /account/:recordId — but that won't save.

The Salesforce documentation recommends removing the colon — that doesn't work either. I was able to save as /account/detail — but when logged in as the user, I get "Invalid Page".

I'm pulling my hair over this! Can you help?!?

  • 3
    Hard to believe that the most simple thing and such a basic item for a community is either not possible or so poorly documented that it is a guess at how to use it with no real success stories out there
    – Eric
    Commented Apr 12, 2017 at 22:36
  • 1
    Just to clarify, are you trying to pull up the Account SObject record that is associated with the current user (via their Contact)?
    – dsharrison
    Commented Apr 12, 2017 at 23:03
  • @D.S. - Trying to simply get the page to be able to be added to the navigation menu and populating the account Id. And yes since it is a community it would come from the current user. No different that the standard Account Detail Page which shows the URL as being /account/:recordId when you click on page properties
    – Eric
    Commented Apr 12, 2017 at 23:13

3 Answers 3


The record detail page aspect of the Napili Community is very confusing. Correct me if I am wrong but it looks like you created a set of record pages for Account. This gave you Account Detail, Account List, and Account Related List. Placing the Account Detail page as a top level link requires you to hardcode it to a direct Account Id by replacing :recordId with an actual live Id such as 001E0000014chufIAA. I am not sure what the actual use case is for this, but this is the functionality Salesforce built. Instead, you could link to the Account List page (where the user should only be able to see their personal account) then have them click on their Account name to navigate to their Account Detail.

A better solution that would require a little bit of coding would be to create an intermediate lightning component that will get the current User's Account Id using an Apex controller, then in the callback redirect the user to the account detail page using their Account Id. You would then place this on a new community page and use that page as the target for your navigation link.

Here's to hoping that Salesforce adds a 'My Contact' and 'My Account' concept as standard pages in Napili!

Edit - Account Page Creation

@Eric mentioned that he did not in fact create the pages as I noted above but they already existed in his org. My guess is that this difference between orgs has to do with my org being created quite a long time ago so I did not have the pages out of the box.

Eric Edit

Here are the steps I took based on this answer:

  1. Apex controller to return user's Contact AccountID
  2. Lightning Component with an Init event that uses force:navigateToSObject based on the Id from #1. This takes you to the appropriate Account Detail Object Page
  3. In Lightning controller Init comment out the event.fire (needed so we can publish the page)
  4. Create a "Navigate To Account" page in the community
  5. Add the component to the page in the community (ensure you did step #3)
  6. Publish the page to the community
  7. Uncomment the event.fire from #3
  8. Edit the navigation menu, add an item that goes to the community page you created
  9. publish and upon clicking the navigation item you will be taken to the user's account
  • The default template provide no way for the user to even view their account page. The use case is - Add a link on the navigation bar to view the account detail page. Simple as that. And no new pages were created. Simply adding a navigation item to the default account detail page
    – Eric
    Commented Apr 12, 2017 at 23:31
  • @Eric I agree that the default template provides no way for the user to view their Account. However, without creating a set of object pages for 'Account' I don't have a standard 'Account Detail' page. Is yours different than the standard record view page for Account?
    – dsharrison
    Commented Apr 12, 2017 at 23:38
  • As soon as you enter the builder - Where is says Home -> click the drop down -> Under object pages -> Account Detail.
    – Eric
    Commented Apr 12, 2017 at 23:45
  • Okay yeah we are talking about the same pages. For some reason they don't exist in my org until I go through the flow to create them for the 'Account' SObject. This probably has to do with when my org was created. What I stated above in my answer holds then. These pages are generic pages for the Account SObject and not tied to the concept of 'My Account' as they seem like they might be. This is a pretty big oversight and I don't think it is possible to get the 'My Account' functionality without the bit of custom work.
    – dsharrison
    Commented Apr 12, 2017 at 23:48
  • 1
    Yea account list is not acceptable for a customer community. Boooo. Thanks for the effort into the answer. It may be the only way currently.....
    – Eric
    Commented Apr 13, 2017 at 0:40

I have a write up and some working code that handles exactly this use case here.. The basic gist of it is, create a component that grab's the logged in user's account id via apex, then in the callback, navigate the user to their account page. Put this action as the init handler of the component, then drop the component on a standard community page (not an object page). The page with that component just serves as a dynamic redirect. Finally, use that page in your navigation menu.

One thing you'll want to update in the component controller:

redirectToAccount: function(component, event, helper) {
    var loggedInUser, navEvt, state;

    var action = component.get("c.getLoggedInUser");
    action.setCallback(this, function(response) {
        state = response.getState();
        if (state === "SUCCESS") {
            loggedInUser = response.getReturnValue();
            // add check for users without contact Id / account Id
            // YOUR CODE HERE

            // otherwise do
            navEvt = $A.get("e.force:navigateToSObject");
                "recordId": loggedInUser.Contact.AccountId,
                "slideDevName": "detail"
  • Thanks, @Jake. The code is beyond my skills, but I'll pass the suggestion along to the Salesforce tech support guy working on my case.
    – Cheri
    Commented Apr 14, 2017 at 18:21
  • @Jake, I tried following your blog post and think the part where you commented ` // add check for users without contact Id / account Id // YOUR CODE HERE` is causing an error for me. I can't save the page with the myAccountRedirect component due to to the error: This page has an error. You might just need to refresh it. Error in $A.getCallback() [Cannot read property 'AccountId' of undefined] Callback failed: apex://NapiliCommunityController/ACTION$getLoggedInUser Failing descriptor: {markup://c:myAccountRedirect} Any thoughts or quick fixes?
    – Adam G
    Commented Aug 5, 2017 at 21:33
  • @AdamG A lazy way to get around that error would be to add: if (!loggedInUser || !loggedInUser.hasOwnProperty('Contact') || !loggedInUser.Contact.hasOwnProperty('AccountId')) break; but I recommend a more robust solution that meets your specific business requirements. My post was not meant as a copy-paste solution and leaves the final implementation for a developer to complete per specific requirements. Commented Aug 6, 2017 at 22:42

Can I link to an answer I just wrote on the exact same topic?

Napili Navigation Menu

Solution that doesn't require writing a redirect page- but it does still require a reasonable amount of dev/effort.

I think this probably provides the best UX.

You must log in to answer this question.

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