Loading

Lookup field in lightning:recordEditForm needs to be included in Page Layout

게시 일자: Jul 5, 2023
상세 설명
When using Lookup Field in lightning:recordEditForm, the field value may not show the existing data. This is because the lightning:inputField is currently populated only when the field is added to Page Layout. This behavior is also seen with Lightning Web Component (LWC) version of Record Edit Form (lightning-record-edit-form)
 
솔루션
Create a Lightning Component tab with following code 
<aura:component implements="force:appHostable"> 
  <lightning:card title="Lookup Field Edit"> 
    <lightning:recordEditForm recordId="a00S6000000xxxxxxx" objectApiName="CustomObject__c"> 
      <lightning:inputField fieldName="Account__c" /> 
    </lightning:recordEditForm> 
  </lightning:card> 
</aura:component>
Open tab and see the field value shows 'Search..' if the field is not added to Page Layout. Field will be correctly populated when added to the Page Layout. 
 
Knowledge 기사 번호

000380201

 
로드 중
Salesforce Help | Article