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).
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:
000380201

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.