0
// Navigate to View Account Page
navigateToViewAccountPage() {
    this[NavigationMixin.Navigate]({
        type: 'standard__recordPage',
        attributes: {
            recordId: this.recordId,
            objectApiName: 'Account',
            actionName: 'view'
        },
    });
}

Currently, I am using the above code. It is navigating to the Detail tab of the record page. But I need to navigate to the custom tab created on the record page.

Is there any way that we can navigate to custom tab on record page?

enter image description here

1 Answer 1

0

Below code should help you to navigate to custom tab

this[NavigationMixin.Navigate]({
            type: 'standard__navItemPage',
            attributes: {
                apiName: CustomTabApiName
            },
          state: { 
                c__id: this.recordId 
           }
});

You can refer here for more details

3
  • Hi Rohit, I have tried this but it is not working. PageNot Exist error is occurring. I need to navigate to the tab we create on the Lightning page not the tab we create from setup
    – Jhony
    Commented Feb 11, 2022 at 9:54
  • @Jhony - I have updated my answer above, while passing the recordId, you would need to prefix c__id.
    – Rohit
    Commented Feb 11, 2022 at 10:54
  • 1
    i would highly encourage you to explain why you are proposing this approach, why the state property, etc,etc, instead of just dumping code as an answer. Thanks
    – glls
    Commented Feb 11, 2022 at 12:44

You must log in to answer this question.

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