I want to create custom lookup field without using lightning-edit-record-form. Notify to when completed = lookup(users), its not fetching the users name. Here is what I coded:
<lightning-input
class="requiredfield"
type="search"
name="notifyToWhenCompleted"
variant="label-hidden"
placeholder="Search Users"
value={userName}
onchange={myLookupHandle} onkeydown={searchHandleClick} onclick={searchHandleClick}
style="padding-bottom:20px; width:275px; font-weight:normal; color:#424345;">
</lightning-input>
JS
myLookupHandle(event){
console.log(event.detail);
this.milestoneId = event.detail;
this.userName = event.target.value;
}
searchHandleClick(event){
this.isShowResult = true;
this.messageResult = false;
}
searchHandleKeyChange(event){
this.messageResult=false;
this.userName = event.target.value;
}
@wireand/or apex code, you sure the problem is in this piece of javascript and not with for example permissions to use the apex class or not having thecacheable=true? Have you seen github.com/pozil/sfdc-ui-lookup-lwc ? maybe it's better to use a ready component created by Salesforce employee?