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 display 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 the Salesforce app, 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, Salesforce app, and Lightning communities.

Note

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.

Record IDs corresponding to ContentNote SObjects aren’t supported.

Note

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.