Loading

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

Date de publication: Jun 25, 2026
Description

When using a Lookup field inside a lightning:recordEditForm (Aura) or lightning-record-edit-form (Lightning Web Component), the field may display "Search..." instead of showing the existing record value. This occurs because lightning:inputField only renders the current field value when the field is included in the object's Page Layout. This behavior affects both Aura components and Lightning Web Components (LWC).

Résolution

How to Reproduce
Create a Lightning Component tab with a lightning:recordEditForm referencing a specific record (using its recordId) and a lightning:inputField pointing to a Lookup field (for example, Account__c on a custom object). When you open the tab, if the Lookup field is not added to the Page Layout for that object, the field displays "Search..." even when the record has an existing Account value.

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. 
 

Resolution: Add the Field to the Page Layout
To display the existing Lookup field value correctly, add the Lookup field to the Page Layout of the relevant object in Salesforce Setup. Once the field is included in the Page Layout, the lightning:inputField correctly populates with the existing record value when the component is rendered.
Steps:

  1. Go to Setup > Object Manager > [Your Object] > Page Layouts.
  2. Open the relevant Page Layout.
  3. Drag the Lookup field from the field palette into the layout.
  4. Save the Page Layout.
  5. Reload the Lightning Component tab to confirm the Lookup field now shows the existing value.

 

Numéro d’article de la base de connaissances

000380201

 
Chargement
Salesforce Help | Article