Newer Version Available

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

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.

1editRecord : function(component, event, helper) {
2    var editRecordEvent = $A.get("e.force:editRecord");
3    editRecordEvent.setParams({
4         "recordId": component.get("v.contact.Id")
5   });
6    editRecordEvent.fire();
7}

This event is supported in Salesforce1 only. If used outside of Salesforce1, this event won’t be handled properly.

Note

Attribute Name Type Description
recordId String Required. The record ID associated with the record to be edited.