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
sumit dsumit d 

Aura navigation to record not working

Hi All,
          I have a Aura component in which i want to redirect it to the record in another window. but its not working
My component is given below:- 

<aura:component implements="force:hasRecordId" access="global">
    <aura:attribute name="obName" type="String" />
    <aura:attribute name="fieldName" type="String" />
    <aura:attribute name="record" type="Object"/>
    <aura:attribute name="simpleRecord" type="Object"/>
    <aura:attribute name="recordError" type="String"/>
    <aura:attribute name="pageReference" type="Object"/>
    <lightning:navigation aura:id="navService"/>
    <force:recordData aura:id="recordLoader"
                      targetError="{!v.recordError}"  />
    <!-- Display a header with details about the record -->
    <div class="slds-page-header" role="banner">
                <p class="slds-text-heading--label"><a onclick="{!c.redirectDetail}">
                    <lightning:formattedText value="{!v.simpleRecord.Name}" />

Js File
    doInit : function(component, event, helper) {
        var sobject = component.get('v.record');
        var fieldName = component.get('v.fieldName');
        var formatText = component.find('fielddata');
    redirectDetail : function(component, event, helper) {
        //Redirect to detail page on success
        var navService = component.find('navService');
        var pageReference = {
            type: 'standard__recordPage',
            attributes: {
                "recordId": component.get("v.recordId"),
                "objectApiName": component.get("v.obName"),
                "actionName": "view"
AnkaiahAnkaiah (Salesforce Developers) 
Hi Sumit,

Refer the below links will help you resolve the issue.

If this information helps, Please mark it as best answer.