Sunday, September 24, 2023
HomeUncategorizedSalesforce | What's the Search Field In Aura Element? | The Developer...

Salesforce | What’s the Search Field In Aura Element? | The Developer Information


A search field in an Aura part is a person interface factor that permits customers to enter textual content and seek for related info throughout the part or its related information. In Aura, the search field could be applied utilizing the <lightning:enter> part with the sort=”search” attribute. This part gives a textual content enter subject together with a search icon that can be utilized to provoke the search. 

When a person varieties within the search field and clicks the search icon or presses enter, the part can execute a server-side controller motion or a client-side JavaScript operate to retrieve and show the search outcomes. The search performance could be personalized to match the necessities of the part, reminiscent of looking based mostly on particular fields or filters. 

General, the search field is a typical UI factor utilized in many Aura parts to permit customers to shortly discover the info they want. 


<aura:part controller="searchAccountController" > 
    <aura:attribute identify="keywordHolder" sort="string" />   
    <aura:attribute identify="accountList" sort="record" />   
    <lightning:enter identify="AccountSearch"  label="Enter Account Identify" worth="{!v.keywordHolder}"/>   
    <lightning:button label="Search Account" onclick="{!c.findAccount}" /> 
    <aura:iteration var="acc" objects="{!v.accountList}" >    

dont miss out iconDo not forget to take a look at: Use Aura Component in Screen Flow | Salesforce Flow Builder Tutorial


 findAccount : operate(part, occasion, helper) {  
        var motion=part.get('c.fetchAccount'); 
            searchKeyWord : part.get("v.keywordHolder")          
            var state=response.getState(); 
            var response1=response.getReturnValue(); 

Apex Controller:  

public class searchAccountController { 
 public static Record < account > fetchAccount(String searchKeyWord) { 
  String searchKey = searchKeyWord + '%'; 
  Record < Account > returnList = new Record < Account > (); 
  Record < Account > lstOfAccount = [select id, Name, Type, Industry, Phone, Fax from account where Name LIKE: searchKey limit 1]; 
  for (Account acc: lstOfAccount) { 
  return returnList; 

dont miss out iconTry one other superb weblog by Narendra Kumar right here: How to Send Emails Using Lightning Web Component (LWC)?



Source link



Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments