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
Øyvind Borgersen 10Øyvind Borgersen 10 

Lightning component navigate to record


I've created a lightning component as a list view of cases. From that listview I have a button which should navigate to the record on the listview.
I've tried a couple of version with :navigateToUrl without any luck.

How do I create the controller which navigates to the selected record?

Best Answer chosen by Øyvind Borgersen 10
Raj VakatiRaj Vakati
You can do it by using  lightning:navigation

Refer this link
ge : function(component, event, helper) {
        var navLink = component.find("navLink");
        var pageRef = {
            type: 'standard__recordPage',
            attributes: {
                actionName: 'view',
                objectApiName: 'Contact',
                recordId : '0037FXXX51uq5QAA' // change record id. 
        navLink.navigate(pageRef, true);