You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom Record Search Functionality on Account Object using ‘for:each template’ With Table Rows And Cells In Salesforce Lightning Web Component – LWC
#4
Open
vijayk3327 opened this issue
Jul 12, 2023
· 0 comments
Hey guys, today in this post we are going to learn about Create Custom Record Search Functionality on Account Object using ‘for:each template’ With Table Rows And Cells In Salesforce Lightning Web Component – LWC.
Hey guys, today in this post we are going to learn about Create Custom Record Search Functionality on Account Object using ‘for:each template’ With Table Rows And Cells In Salesforce Lightning Web Component – LWC.
→ Get source code live demo link:-
Step 1:- Create Lightning Web Component : lwcSearchAccountList.html
`
Custom Search Functionality on Account Object in LWC.
Step 2:- Create Lightning Web Component : lwcSearchAccountList.js
` import { LightningElement, track, wire } from 'lwc';
import getAccounts from '@salesforce/apex/lwcApexController.searchAccountNameMethod';
const DELAY = 100;
export default class LwcSearchAccountList extends LightningElement {
accountName = '';
accountPhone = '';
accountWebsite = '';
accountIndustry = '';
accountDescription = '';
@track accountList= [];
@wire (getAccounts,{
accStrName:'$accountName',
accStrPhone:'$accountPhone',
accStrWebsite:'$accountWebsite',
accStrIndustry:'$accountIndustry',
accStrDescription:'$accountDescription'
})
retrieveAccounts({error, data}){
if(data){
this.accountList=data;
}
else if(error){
}
searchAccountAction(event){
//this.accountName = event.target.value;
const searchString = event.target.value;
window.clearTimeout(this.delayTimeout);
this.delayTimeout = setTimeout(() => {
this.accountName = searchString;
}, DELAY);
}
}`
Step 3:- Create Lightning Web Component : lwcSearchAccountList.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>45.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__AppPage</target> <target>lightning__RecordPage</target> <target>lightning__HomePage</target> <target>lightning__Tab</target> </targets> </LightningComponentBundle>
→ Get source code live demo link:-
The text was updated successfully, but these errors were encountered: