Mass Approval using Lightning Web Component in Salesforce
Sample code: Apex Class: public class MassApprovalController { @AuraEnabled( cacheable = true ) public static List < MassApprovalWrapper > fetchPendingApprovalRecords() { List < ....
Sample code: Apex Class: public class MassApprovalController { @AuraEnabled( cacheable = true ) public static List < MassApprovalWrapper > fetchPendingApprovalRecords() { List < ....
Sample Code: HTML: <template> <lightning-card title="Prechat Form"> <template class="slds-m-around_medium" for:each={fields} for:item="field"> <template if:true={field.dropDown} key={field.name}> <div key={field.name}>Priority</div> <select class="slds-select" key={field.name} onchange={handlePriorityChange}> <option label="Low" value="Low"></option> ....
lightning/uiRelatedListApi can be used to fetch the related records and display using Lightning Web Component. Since we use lightning/uiRelatedListApi, apex code is not required to fetch the related records. Check ....
lightning/uiRelatedListApi can be used to find number of related records using Lightning Web Component. Check the sample code below: Sample Code: HTML: <template> <lightning-card> No of Contacts is ....
Sample Code: HTML: <template> <lightning-card class="slds-m-around_small"> <lightning-textarea max-length="100" message-when-value-missing="Please enter the description" label="Description" required value={description} onchange={handleChange} class="textAreaCSS"></lightning-textarea> </lightning-card> </template> JavaScript: import { LightningElement } from 'lwc'; export default class DataTable ....
Use '$variableName' while calling wire method instead of using this.variableName. This will avoid the undefined variable issue while calling Wire method in Salesforce. Check the following sample code. '$userId' will not ....
Sample JS-meta.xml: <?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>52.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__RecordAction</target> <target>lightning__RecordPage</target> </targets> <targetConfigs> <targetConfig targets="lightning__RecordAction"> <actionType>Action</actionType> <objects> <object>Account</object> ....
HTML img tag can be used to display image in Salesforce Lightning Web Component. In the following example, I have used Static Resource to store the image. Image__c is a ....
To left align and set currency code in lightning datatable in Salesforce Lightning Web Component, use cellAttributes: { alignment: 'left' }. Please check the following sample code for reference. Sample ....
Sample Code: Apex Class: public with sharing class AccountController { @AuraEnabled public static String createAttachment( Id accountId ) { String result = 'Success'; try { Attachment a = new Attachment(); ....