Hi I'm using jQuery mobile to render records and on each link I want to just redirect to the record view page. I'm using sforce.one.navigateToSObject on the href attribute, which works fine. But when I click on the back arrow on the record page, it takes me back to the home page of the lightning app, instead of the custom page that displays the records. Any ideas?
You'll want to look at the Managing Navigation Section of the Salesforce1 Mobile App Developer Guide, particularly Navigation with the sforce.one Object.Tthe back button works differently in Salesforce1 than in the standard platform from a regular browser. Your code will need to be adjusted to take this into account.
As an example, here's what it says about
Navigates to the previous state that’s saved in the sforce.one history. It’s equivalent to clicking a browser’s Back button.
refresh is optional. By default, the page doesn’t refresh. Pass true to refresh the page if possible.
Now, you're using
navigateToSObject(recordId[, view]) to get to a Lightning Page. Here's what it says about that command:
Navigates to an sObject record, specified by recordId. This record “home” has several views, which in Salesforce1 are available as slides that the user can swipe between.
view is optional and defaults to detail. view specifies the slide within record home to display initially. The possible values are as follows.
- detail: the record detail slide
- chatter: the Chatter slide
- related: the view of related slide
Okay, you're probably wondering why I'm telling you all this. The reason being that the above command is obviously intended for use to get to a standard Object view and was never intended to get to a Lightning page to view an Object record.
If you look at how Lightning Components are being implemented on the platform, they're being implemented via Actions. If you use an Action to get to your Object view I strongly suspect your back button will return you to your previous view on the Lightning page.