How do you create a custom lookup field in lightning component?
How to create custom Lookup in lightning component
- Step 0 : Create Support SVG Lightning component.
- Step 1 : Create Apex Class Controller.
- Step 2 : Create Lightning Event.
- COMPONENT BLUEPRINT :
- Step 3 : Create Child Component For Display the Search Result List.
- Step 4 : Create Lightning Custom Lookup Component.
How to create custom lookup component in Salesforce Lightning?
Step-2: Now we will create the CustomLookup lightning component. For creating a new lightning component navigate to Developer Console > File > New > Lightning Component Enter Name & Description and click Submit. Now component markup file will open y default. In the right sidebar, click on Controller, Helper, and Styleto create those files too.
How to create custom lookup in Lightning component-SFDC monkey?
Step 1 : Create Apex Class Controller. In above Apex class we have only one @AuraEnabled Method. In this method we have one String ‘searchKeyWord’ parameter. By this parameter we are find Account record List and Return the list. Next we create a Lightning Event bundle for communicate data (attribute values) between different components.
Which is the searchcontent method in Lightning?
The searchContent method is used for assigning sample records to fetchedRecords aura attribute. You can replace the existing sample code with functional one which can fetch the records from the apex controller on the server side. add/removeClass – overridden method for adding or removing style class.
What are the features of a custom lookup component?
Custom Lookup component Features: Single component Will work on any object Spinner to show processing Ability to set sObject Icon Option to set placeholder & label Ability to show error in the dropdown if any occurred. You can set a number of records to show at once. Default is 5 Also Check, Multi Select Lookup Lightning Component Demo GIF: