0

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;
 }
1
  • you didn't include @wire and/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 the cacheable=true? Have you seen github.com/pozil/sfdc-ui-lookup-lwc ? maybe it's better to use a ready component created by Salesforce employee? Commented May 4, 2022 at 13:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.