CREATE A LIGHTNING WEB COMPONENT FOR ACCOUNT LOOKUP & SEARCH RECORD FUNCTIONALITY USING A SEARCH BOX

preview_player
Показать описание
Create a Lightning Web Component (LWC) that enables users to search for records and perform Account lookup functionality using a search box.

🌟JOIN US and SUBSCRIBE for more!🌟

🌟Support:
This is my full-time job, so donations are greatly appreciated but never required. If you choose to donate, please note that they are non-refundable.

Thank you for your support! 🙏

Playlist:

#Salesforce #LWC #WebComponents #DeveloperGuide #salesforce #lightningwebcomponent #lightningcomponent #lightningwebcomponents #learnlightningwebcomponent #lightning #salesforcelightning #salesforce #lightningwebcomponent #salesforcetrainer #learnsalesforce #salesforcedevelopment #salesforcedevelopers #lightningwebcomponent, #lightningwebcomponents, #lightningcomponent, #learnlightningwebcomponent, #salesforcelightning, #lightning, #toastinlightning, #flowsinsalesforcelightning, #lightningexperience, #lwcalert, #lightningdataservice, #databindinginlightning, #whatislightningmessageserviceinlwc, #emailtemplateinsalesforcelightning, #emailtemplatesinsalesforcelightning, #salesforcelightningwebcomponents, #lightning #web #component #lightning #web #components #lightning #component #lightning #lookup #screen #component #in #salesforce #lightning #flow #lightning #web #components #salesforce #how #to #create #lookup #in #lightning #web #component #create #a #hello #world #lightning #web #component #create #a #lightning #web #component #(lwc) #that #enabl #learn #lightning #web #component #lookup #in #lightning #component #create #lightning #web #components #lookup #component #in #lightning #flow
Рекомендации по теме
Комментарии
Автор

Apex Class:

public with sharing class AccountLookupController {

@AuraEnabled(cacheable=true)
public static List<Account> getAccounts(String actName){
List<Account> accountList = new List<Account>();
if(actName != ''){
String accountName = '%' + actName + '%';
accountList = [SELECT Id, Name FROM Account WHERE Name LIKE :accountName];
}
return accountList;
}
}


HTML Code:

<template>
<lightning-card title="Account Records"
<div
<lightning-input type="search" value={accountName} onchange={handleKeyChange}
</div>

<div if:true={messageResult}
<p Result Found!</p>
</div>

<template
<div
<ul
<template for:each={accountList} for:item="actObj">
<li key={actObj.Id} data-value={actObj.Id} data-label={actObj.Name}
class="slds-p-around_small slds-text-link" style="cursor: pointer;">
{actObj.Name}
</li>
</template>
</ul>
<div if:true={accountId}
<p Account Id: {accountId}</p>
</div>
<div if:true={accountName}
<p Account Name: {accountName}</p>
</div>
</div>
</template>
</lightning-card>
</template>

tejasvispute