"Lightning:recordForm" which suppresses using "lightning:recordEditForm and lightning:recordViewForm" separately to handle record view and edit.
"lightning:recordForm" is very powerful component for editing,viewing and adding
a record in lightning.
<aura:attribute name="fieldArray" type="String[]"
default="['Name','Email','Phone','AccountId']"/>
<lightning:recordForm aura:id="recordForm"
recordId="{!v.recordId}"
objectApiName="contact"
fields="{!v.fieldArray}"/>
Note : "ObjectApiName" is always required while using lightning:recordForm component.
No comments:
Post a Comment