Newer Version Available

This content describes an older version of this product. View Latest

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.

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

Note

1createRecord : function (component, event, helper) {
2    var navEvt = $A.get("e.force:navigateToSObject");
3    navEvt.setParams({
4      "recordId": "00QB0000000ybNX",
5      "slideDevName": "related"
6    });
7    navEvt.fire();
8}

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

Note

Attribute Name Type Description
recordId String Required. The record ID.
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.