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
VijayNiVijayNi 

Lightning navigation in app

Hi Team,

We have a requirement where on lightning app when user clicks on a button he should be navigating to another page .
How to achevie this using aura compoent .
 
Best Answer chosen by VijayNi
SwethaSwetha (Salesforce Developers) 
HI Vijay,
Check out https://salesforce.stackexchange.com/questions/75431/how-to-go-from-one-lightning-page-to-another-lightning-page-through-a-click

The force:navigateToURL event is used to navigate to a URL.
Use a relative url to stay in your current app and go to a different page.
goToNewPage: function(component, event, helper) {

    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
        "url": "/newPage"
    });

    urlEvent.fire();
}

Use an absolute URL to open an external website in a new browser tab.
goToExternalSite: function(component, event, helper) {

    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
        "url": "http:www.google.com"
    });

    urlEvent.fire();
}

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you