0

I have created a a lightning component record edit form in VF, which has a input lookup field for custom object named Heading. In the lightning component when I search for a Heading name, it will display the heading names.

The issue is consider I am searching for a name Accountants, and in the Heading object we have 10 records with name Accountants (we are differentiating with code). In my lookup search it will show only 5 Accountants, I am not able to view the other 5 with different codes. If I do the same in record level,then there is a search pop will appear which shows all lightning.

Whether we can show the same pop up search window in record edit form

<lightning:recordEditForm aura:id="recordViewForm" recordId="{!v.recordId}" objectApiName="SampleListing__c" >
        <lightning:messages />        
        <div class="slds-form_horizontal slds-form slds-grid slds-wrap">                
            <lightning:outputField aura:id="firstNameField" class="slds-size_6-of-8 left-align" fieldName = "Name" />
            <lightning:outputField aura:id="DField" class="slds-size_6-of-8 left-align"   fieldName="Dir__c"  />               
            <lightning:inputField aura:id="DSField" class="slds-size_6-of-8" fieldName="Section__c"  />
            <lightning:inputField aura:id="DHField" required="true" class="slds-size_6-of-8" fieldName="Heading__c" />                      
        </div>
        <div class="slds-m-top_medium">
            <lightning:button class="slds-m-top_small" variant="brand" name="update" label="Execute" onclick="{!c.onSubmit}"/>
        </div>        
    </lightning:recordEditForm>
0

I have used this component and the search popup works for me.

enter image description here

Just click the search box and it will open.

enter image description here

This is the sample code I have used. Just Contact object fields which includes Account as lookup.

<lightning:recordEditForm
       onload="{!c.handleLoad}"
        onsubmit="{!c.handleSubmit}"
        onsuccess="{!c.handleSuccess}"
        objectApiName="{!v.sObjectName}">
       <!--  the messages component is for error messages -->
        <lightning:messages />

        <lightning:inputField fieldName="LastName" aura:id="LastName"/>
        <lightning:inputField fieldName="AccountId" aura:id="AccountId"/>
        <lightning:inputField fieldName="Birthdate" aura:id="Birthdate"/>
        <lightning:inputField fieldName="AssistantPhone" aura:id="AssistantPhone"/>
        <lightning:inputField fieldName="Email" aura:id="Email"/>
        <lightning:inputField fieldName="LeadSource" aura:id="LeadSource"/>
        <lightning:inputField fieldName="Lead_Source_2__c" aura:id="Lead_Source"/>
        <div class="slds-m-top_medium">
            <lightning:button disabled="{!v.disabled}" variant="brand" type="submit" name="save" label="Save" />
        </div>
    </lightning:recordEditForm>

You can find detail code here: https://newstechnologystuff.wordpress.com/2018/10/06/lightningrecordeditform-save-data-without-apex/

  • Whether this pop up search is from lightning:recordEditForm field lightning:inputField search – Rose Dec 12 '18 at 9:59
  • @Rose I'm using lightning:inputField <lightning:inputField fieldName="AccountId" aura:id="AccountId"/> – Tushar Sharma Dec 12 '18 at 10:12
  • ,Could you please share the coding as that pop up is not working for me.In the <aura:component controller="Controller" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,lightning:isUrlAddressable,force:appHostable" access="global" > – Rose Dec 12 '18 at 10:27
  • @Rose check my updated answer. – Tushar Sharma Dec 12 '18 at 10:33
  • yes its working from lightning component. But my lightning component is inside the visualforce page.From the VF page that pop up search not working.Thank you for comment – Rose Dec 12 '18 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.