force:navigateToSObject

Navigates to an sObject record specified by recordId.

To display the record view, set the record ID on the recordId attribute and fire the event.

The record view contains slides that displays the Chatter feed, the record details, and related information. This example displays the related information slide of a record view for the specified record ID.
Note

Note

You can set a specific slide in Salesforce1, but not in Lightning Experience.

createRecord : function (component, event, helper) {
    var navEvt = $A.get("e.force:navigateToSObject");
    navEvt.setParams({
      "recordId": "00QB0000000ybNX",
      "slideDevName": "related"
    });
    navEvt.fire();
}
Note

Note

This event is handled by the one.app container. It’s supported in Lightning Experience, Salesforce1, and Lightning communities.

Attribute Name Type Description Required?
isredirect Boolean Indicates that the new URL should replace the current one in the navigation history. The default is false.
recordId String The record ID. Yes
slideDevName String Specifies the slide within the record view to display initially. Valid options are:
  • detail: The record detail slide. This is the default value.
  • chatter: The Chatter slide
  • related: The related information slide
This attribute has no effect in Lightning Experience.