Lightning

How to use Lightning:navigation to navigate another component

use of Lightning navigation to navigate another component

Use: We use lightning:navigation component to navigate custom component.

Functionality:

Short description: Using lightning:isUrlAddressable ( add new interface in Summer 18 release ) interface , we can handle which Lightning component can be opened.Usually lightning:navigation component generate a URL and navigate that URL using navigate() function.

Example :
Back to list

5 thoughts on “How to use Lightning:navigation to navigate another component

  1. Anil says:

    Hello thanks for your article ,the same logic is not working for custom object do i need to do any adaptation?

    1. Nigam says:

      Try this code for recordPage navigation

      var navLink = component.find("navLink");
      var pageRef = {
      type: 'standard__recordPage',
      attributes: {
      actionName: 'view',
      objectApiName: 'Job__c',
      recordId : '0hj7FXXX51uq5QAA' // change record id.
      },
      };
      navLink.navigate(pageRef, true);

  2. amrita says:

    where are the codes for this?

  3. Subba Reddy says:

    Hi,
    I have one scenario when i click on image icon, i want to open Potential Duplicates(This is standard component) page.
    Can you please suggest me on this ASAP it’s business critical if you give response it will help me alot. thanks in adavance.

  4. SRK says:

    Thank you!It’s working properly 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *