force:editRecord

Opens the page to edit the record specified by recordId.

To display the record edit page for an object, set the object name on the recordId attribute and fire the event. This example displays the record edit page for a contact that’s specified by recordId.

editRecord : function(component, event, helper) {
    var editRecordEvent = $A.get("e.force:editRecord");
    editRecordEvent.setParams({
         "recordId": component.get("v.contact.Id")
   });
    editRecordEvent.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?
recordId String The record ID associated with the record to be edited. Yes