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.

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. If used outside of Lightning Experience or Salesforce1, this event won’t be handled automatically. To use this event outside of one.app, create and wire up an event handler of your own.

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