Posts

Showing posts with the label Lookup

Generic Custom Lookup Lightning Web Component

Hello Trailblazers,   In this blog I have created generic lookup component using LWC which can be used directly without changing single line of code. You just have to pass object name, fields to be retrieved and fieldname on which search operation should happen while using this component along with event handler method, that’s it you are ready to use record captured in lookup field. Which makes it available for use multiple times in single component.    This example contains below main  components :   1.        GenericLookup   – Apex class for querying records   2.        genericLookup   - LWC Main component - This you will be using as per your need   3.        recordListItem   - LWC to render suggested records   First lets  have a look at GenericLookup class Now create  recordListItem  component This component is...