function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AkshiiiiiAkshiiiii 

navigate to standard tab in lightning component

I have created a Lightning button. On clicking this button I want to navigate to standard "Opportunities" tab.  How can I achieve this?
ShivankurShivankur (Salesforce Developers) 
Hi Akshita,

Please check out the examples shared and which are possible for navigation via lightning component on below link:
https://rajvakati.com/2018/05/29/navigation-in-lightning-experience-using-pagereference/

Hope above information helps. Please mark as Best Answer so that it can help others in future.

Thanks.
mukesh guptamukesh gupta
Hi Akshi,

Please use below code:

cmp:-
<lightning:button label="gotoOpptyTab" variant="neutral"  onclick="{!c.gotoOpprtunityTab }"></lightning:button>
controller.js
 
gotoOpprtunityTab : function (component, event, helper) {
        component.set('v.errorDev',"false");
        var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({
            "url": "/006/o"
        });
        urlEvent.fire();
    },


if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh