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
RohRoh 

NavigatetoSobject not working in lighting

Hello friends,
When i tried navigating from the lightning app page to the record detail page, using the Aura function it fails.
​createRecord : function (component, event, helper) { var navEvt = $A.get("e.force:navigateToSObject"); navEvt.setParams({ "recordId": "00QB0000000ybNX", "slideDevName": "related" }); navEvt.fire(); }

Is there something i am missing here?

Your inputs are appreciated.

Thanks,
Roh
sfdcMonkey.comsfdcMonkey.com
hI Roh
are you trying to naviagte to Lightning App ( apps.app) page to record detail page ? if yes so 
this event is only supported in Lightning Experience and Salesforce1 only. 
add your lightning component to Lightning App builder or salesforce1 tab or lightning experiences page layout and then check it 
i hope it helps you 
thanks 
let me infrom if it helps you 

http://sfdcmonkey.com
Mike HatchMike Hatch
I'm having a similar error, after following the Trailhead lesson https://trailhead.salesforce.com/projects/account-geolocation-app/steps/lc-app-09 explicitly. The call to $A.get("e.force:navigateToSObject") returns 'undefined' when used from the version of the app displayed from the developer console (click on 'Preview').  If I navigate to the app via <mysandboxurl>/one/one.app then it works properly - so the lab instructions are incorrect in instructing me to view the app by launching from the developer console (or the developer console should launch the correct one.app version).
David Roberts 4David Roberts 4
Also, it works on the mobile device but not the desktop/laptop. What does work and what is the test for mobile or not?
If {mobile){
    use e.force:navigateToSObject}
else{
    use a different function?
}
Mahima GuptaMahima Gupta
Try to add
<aura:dependency resource="markup://force:navigateToSObject" type="EVENT"/>
 
LinThawLinThaw
Hi,
I am trying to naviagte to record detail page in Lightning App (one.app).
Is there any way to do that?
Thanks