For questions about Lightning Web Components (LWC) - the UI framework for the Salesforce platform. When using this tag also include the more generic [salesforce] tag.
Questions tagged [lwc]
503 questions
2
votes
1 answer
Using Preact in Lightning Web Component
Recently installed the project noted here: https://developer.salesforce.com/blogs/2020/11/how-to-use-apex-natively-with-svelte-vue-and-preact-within-lwc.html to test a theory on using Preact in a Lightning Web Component. Observed that in the Preact…

dan_flux
- 21
- 1
2
votes
1 answer
Reset Lightning-record-form after creating new record
I'm new to LWC. I want to know that how can I reset the lightning-record-form after saving a record.
File: contactCreator.html
…

Kaushal8899
- 46
- 5
2
votes
1 answer
How to write the jest test for onclick event im salesforce lwc
I have below code. How can i cover in the Jest salesforce?
testhandle(event) {
let testAbr = event.target.text;
if (testAbr) {
this.dispatchEvent(new CustomEvent('testpasss', { detail: { type: 'specilsnumber', input:…

Tarun
- 53
- 5
2
votes
0 answers
React inside LWC
I know there is several posts on that, but they does not answer the below question.
I have built a small POC to integrate react into LWC, I have used lwc-react-webpack-demo as a start base, and was able to create the React todo list example inside…

GoldenAxe
- 838
- 3
- 9
- 26
2
votes
1 answer
Salesforce LWC - Multiple Apex Callout Imperatively Fails
I am trying to make multiple callout to Apex imperatively from a FOR loop. But strangely, only first 6 transaction are getting successful. Rest all are failing. There is no mention of any such limits of number of callout from LWC to Apex in…

Abinash Panigrahi
- 21
- 2
2
votes
2 answers
vis.js Network regeneratorRuntime is not defined [regeneratorRuntime is not defined] error in Salesforce
Trying to use vis.js Network library in Salesforce I have tried both in LWC and in an Aura component with api version 40.0 but am receiving
regeneratorRuntime is not defined [regeneratorRuntime is not defined]
trying to use…

Melissa
- 21
- 3
2
votes
1 answer
Showing a loading indicator while calling Apex in Salesforce LWC
What is the best way to show a loading indicator while retrieving data from Apex in a Lightning Web Component?
I have this approach:
import { LightningElement, api } from "lwc";
import shouldShowCard from…

Daniel Vu
- 33
- 6
2
votes
0 answers
Set Salesforce Variable from D3 on click event in LWC
I am able to visualize my D3 chart within a Salesforce LWC component, but now what I want to do is when I click on a selected node within the D3 code, I want to pass the selected node data to a Salesforce variable that I can then pass to my child…

Stephen
- 175
- 5
2
votes
0 answers
Can we integrate LWC component into REACT JS
I just wanted to give it a try, but before that, I thought of checking in stack overflow. Can we use the LWC (Lighting Web Component) component inside React JS?

Sarath
- 366
- 4
- 19
2
votes
3 answers
Hide/show Button in LWC
I'm new to LWC in salesforce and want to hide/show the button based status. I write below code but it is hiding for all statuses. Can you please help me if am wrong.

RKCY
- 4,095
- 14
- 61
- 97
1
vote
0 answers
Using Three.js with Lightning Web Component (LWC)
I wanted to reach out because I've been working on utilizing the Three.js library alongside LWC to showcase 3D renders (in formats like .fbx or .glb).
However, I'm encountering some issues with the component's functionality.
I've followed the basic…

THE Ramy
- 11
- 3
1
vote
1 answer
How can I obtain the Logged In User's data in LWC on a Salesforce Community Page?
I have a project with the following requirements:
Must work on a Salesforce Community Page (currently testing in a Lightning Home Page).
Must display a list of fields from related records.
There is an Account_Id__c field on User that contains the…

rmoody
- 13
- 3
1
vote
2 answers
Template data displayed is not refreshing after onchnage event of a custom picklist field using In Salesforce LWC
I am displaying records in html template using LWC in salesforce. My columns containing depended fields like country , state and city. When I am modifying displayed data by changing country, then I need to get depended states in my State…

Mr.DevEng
- 2,651
- 14
- 57
- 115
1
vote
1 answer
Promise never getting resolved in LWC Salesforce
I have implemented a promise using the ui/RecordApi to update a record in Salesforce. Strangely that promise never resolves or rejects or even enters finally. Below is a sample code for this. Please note that the record does get updated.
Have you…

user1800524
- 65
- 1
- 5
1
vote
0 answers
Salesforce LWC custom lightning-datatable with picklist
Within a component of a child component that I'm trying to develop, a list containing records to be modified in a datatable is passed to me by a parent component.
However, one field of this datatable is of the picklist type and since the combobox…

Charlie Lomello
- 67
- 2
- 15