Lightning Component Using RecordEdit and RecordView
Lightning componet: <aura:component implements="force:appHostable,force:lightningQuickAction,force:hasRecordId,flexipage:availableForRecordHome"> <aura:attribute name="flag" type="boolean" default="true" /> <aura:attribute name="recordId" type="Id"/> <article class="slds-card"> <aura:if isTrue="{!v.flag}"> <force:recordView recordId="{!v.recordId}" type="FULL"/> <aura:set attribute="else"> <force:recordEdit aura:id="edit" recordId="{!v.recordId}"/> </aura:set> </aura:if> <button class="slds-button slds-button_neutral">Cancel</button> <aura:if isTrue="{!!v.flag}"> ...