You need to sign in to do that
Don't have an account?
jojoforce
a href hyperlink to navigate to SObject in lightning component
I have the following hyperlink and I'm just trying to navigate to the sObject page. However its not redirecting to the record page.
<a target="_blank" class="slds-text-link" href="" onclick="{! c.handleTaskLink }" data-taskid="{!task.Id}">{!task.Subject}</a>
handleTaskLink : function (component, event, helper) { var recordId = event.getSource().getElement().getAttribute('data-taskid'); var navEvt = $A.get("e.force:navigateToSObject"); navEvt.setParams({ "recordId" : recordId, "slideDevName" : "detail" }); navEvt.fire(); },
Also, just to confirm, you can hardcode the recorId and see if the redirect is happening
If you find this information helpful, please mark this answer as Best. It may help others in the community. Thank You!
Anudeep