function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Manoj LabhishettyManoj Labhishetty 

How to prepopulate a lookup field in LWC

Can you please provide the best solution for this ?
Nubes Elite Technologies Pvt. LtdNubes Elite Technologies Pvt. Ltd
Hello Manoj,

You can use the below code:
 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    
    <div class="slds-m-around_xx-large">
        <lightning:recordEditForm recordId="5007F00000SbdGaQAJ" objectApiName="Case">
            <lightning:messages />
            <lightning:inputField fieldName="AccountId"/>
            <lightning:inputField fieldName="ContactId"/>
            <lightning:inputField fieldName="Origin" />
            <lightning:inputField fieldName="Status" />
            <lightning:inputField fieldName="Priority" />
            <lightning:button class="slds-m-top_small" variant="brand" type="submit" name="update" label="Update" />
        </lightning:recordEditForm>
    </div>
</aura:component>

Replace recordId with your required object in above example.

Thank You,
www.nubeselite.com
Development | Training | Consulting

Please mark this as solution if your problem is solved.