1

I have created custom tabs inside an object's flexipage and I wonder if there's a way to redirect via js or apex to this custom tab. For example I want to be redirected to 'Oferta' tab after doing some custom development. enter image description here

Thanks in advance

2
  • Have you taken a look at lightning:navigation, if that solves your use case here?
    – Jayant Das
    Dec 18, 2018 at 13:39
  • @JayantDas Yes, I already checked that and didn't find anything usefull for my case.
    – molinet
    Dec 18, 2018 at 13:51

1 Answer 1

5

You can use standard__navItemPage (Navigation Item Page Type) with lightning:navigation here. Refer to the documentation for pageReference Types those are utilized with the component for details. From documentation:

Navigation Item Page Type

A page that displays the content mapped to a CustomTab. Visualforce tabs, Web tabs, Lightning Pages, and Lightning Component tabs are supported.

Your navigation should look like as below:

{    
    "type": "standard__navItemPage",
    "attributes": {
        "apiName": "MyCustomTabName" // replace with the API name of your custom tab   
    }
}
3
  • Hi Jayant i have used following piece of code i am getting URL doesn't exists error. Nov 7, 2019 at 11:24
  • var pageReference = { "type": "standard__navItemPage", "attributes": { "apiName": "Detail" // replace with the API name of your custom tab } }; component.set("v.pageReference", pageReference); var navService = component.find("navId"); var pageReference = component.get("v.pageReference"); alert(JSON.stringify(pageReference)); event.preventDefault(); navService.navigate(pageReference); Nov 7, 2019 at 11:24
  • this doesn't work for me
    – Patlatus
    Mar 15, 2021 at 8:36

You must log in to answer this question.

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