Creating a contact edit form using the Lightning input field and RecordEditForm components

For a contact edit form, you will need to provide the ID of the record that needs updating. The following example shows how to use the RecordEditForm component to edit a contact record:

<aura:component implements="force:hasRecordId,flexipage:availableForRecordHome">
<div class="slds-p-bottom_large slds-p-left_large" style="width:500px">
<Lightning:recordEditForm aura:id="recordViewForm"
recordId="{!v.recordId}"
recordTypeId="012R00000000000000"
objectApiName="Contact">
<Lightning:messages />
<Lightning:inputField fieldName="FirstName" />
<Lightning:inputField fieldName="LastName" />
<Lightning:inputField fieldName="Birthdate" />
<Lightning:inputField fieldName="Phone" />
<!--Picklist-->
<Lightning:inputField fieldName="Level__c" />
<Lightning:inputField fieldName="LeadSource" />
<Lightning:inputField fieldName="Level__c" />
<Lightning:button aura:id="submit" type="submit" label="Update record" class="slds-m-top_medium" />
</Lightning:recordEditForm>
</div>
</aura:component>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.136.142