Navigate to Record Page

Navigation_ex.Cmp

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction,lightning:hasPageReference,lightning:isUrlAddressable" 
                access="global" >
    
    <lightning:navigation aura:id="navigate" />
    <lightning:button label="Navigation" title="NavigationRec" onclick="{!c.NavigationRec}" />
    
</aura:component>


Js

({
   NavigationRec : function(component, event, helper) {
        
        var pageReference = component.find("navigate");
        
        var pageReferenceNav = {    
            "type": "standard__recordPage",
            "attributes": {
                "recordId": '5006F00001sflqgQAA',
                "objectApiName": "Case",
                "actionName": "view"   
            }
        };
        pageReference.navigate(pageReferenceNav, true);
    }
})




O/p:




Comments

Popular posts from this blog

Lightning Grid Custom Datatable

Comparing Two Values Using Aura If

Dynamic Standard Datatable Using Fieldset