+ Start a Discussion
divya1234divya1234 

Pagerefrence method is not redirecting a page to custom object page

Lightning Button is not navigating a page to custom object record page. when i cick on navigate button nothing is happning. What am i missing here? i  am trying to navigate to custom object record page from lightning componenent
 
// Component Button
<lightning:navigation aura:id ="navService"/>

<div class="slds-p-top_medium">
                <lightning:button value ="Navigate" label="Navigate"  onclick="{!c.navigateENT}" />
     </div>

//helper Method

 navigateENT: function(component, event, helper) {
       var navService =  component.find("navService");
       var pageReference = {            
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'Request__c',
                actionName: 'list'
            },
            state: {
               filterName: 'Recent'
            }
        };
        navService.navigate(pageReference);
    },

 
AnudeepAnudeep (Salesforce Developers) 
Hi Divya, 

Please see example here

https://developer.salesforce.com/docs/component-library/bundle/lightning:navigation/documentation 

Guess you have to use var pageReference = cmp.get("v.pageReference");

If it doesn't work, try force:navigateToURL

https://developer.salesforce.com/docs/component-library/bundle/force:navigateToURL/documentation

If this solves your issue please mark this answer as correct, it may help others 
AnudeepAnudeep (Salesforce Developers) 
You can also check browser developer tools console (Launched by F12) to troubleshoot any errors while clicking the button