Build a form with the lightning:recordEditForm component to add a Salesforce record or change fields in an existing record. The part shows fields along with their labels and current values, as well as allowing you to modify them.
The following features are supported by lightning:recordEditForm.
- Provided the document ID, editing the required fields of a record.
- Creating a record with the fields you like.
- Changing the form's layout.
- Custom rendering of record data
Use lightning:recordForm instead if you don't need customizations.
Don't forget to check out: 8 Foolproof Steps to Salesforce Classic to Lightning Migration
Using lightning to specify editable fields:
Provide feedback within the lightning, there are many field components: component recordEditForm. See the section on Editing a Record for more details. To display record fields as read-only in lightning:recordEditForm, use lightning:outputField components to specify those fields. You can also use HTML and other display components.
Working with Salesforce Data:
To build or update record data, lightning:recordEditForm uses Lightning Data Service and does not need any additional Apex controllers. This component also handles field-level protection and sharing for you, ensuring that users only see data that they have permission to see. See Lightning Data Service for more information.
Allow lightning:recordEditForm to load and handle the data for you whenever possible.
If you're dealing with an object that the User Interface API doesn't support, or if you need to select records using a SOQL query, you can use Apex. In the Lightning Aura Components Developer Guide, see using Apex for more details.
Editing a Record:
Pass in the record ID and the corresponding object API name to be edited to allow record editing. Using lightning:inputField, specify the fields you want to appear in the record edit layout.
Include a type="submit" lightning:button part. When you press the Enter key or click the button, the fields are validated and the values are sent.
Check out another amazing blog by Marziya here: Flosum Tool - Release Management & Continuous Integration for Salesforce
<aura:component> <lightning:recordEditForm recordId="002XXXXXXXXXXXXXXX" objectApiName="Contact"> <lightning:messages /> <lightning:outputField fieldName="AccountId" /> <lightning:inputField fieldName="FirstName" /> <lightning:inputField fieldName="LastName" /> <lightning:inputField fieldName="Email" /> <lightning:button class="slds-m-top_small" variant="brand" type="submit" name="update" label="Update"/> </lightning:recordEditForm> </aura:component>