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
0
votes
1 answer
0
votes
0 answers
VSCode imported method comment not displayed in intellisense
I have a method in utils file that is commented like this, the body is not important.
/**
* Calculates width of the column.
*
* @param {string} text text.
* @param {boolean} hasTooltip does title have tooltip?
* @return {number} width of the…

Zobla
- 123
- 2
- 7
0
votes
0 answers
update the state slice in redux lwc from the action payload
below is my code to update the state.customer slice. However when this runs, I see that the next state is not updated with the payload dispatched from the action. can some one please point out what I'm missing?
reducer:
const initialState1 =…

Roy
- 1
- 1
0
votes
0 answers
Dynamic Field in Lightning web component salesforce
We need to create a lightning web component where we would input the following fields of the Case Object (These fields would be dynamic. Can be changed without changing any code. Make all fields required):
Account
Contact
Type
Case…

Mukul Gautam
- 1
- 1
0
votes
1 answer
LWC: What's wrong with the Wire Return code?
Problem is with this line in JS code inside result function-
return this.wirestoredrecords.data.LastName;
I am trying to get the Contact Fields Values using Getter and display in the HTML. PLS HELP.
**JS CODE:**
import { api, LightningElement, wire…

Praveen Behera
- 444
- 2
- 8
- 17
0
votes
1 answer
how to use reducerrors method to handle errors in lightning web component?
Can Anyone explain please why did we write ": [ ] " in line 10. I believe it is the simplest way to write but what exactly is this, can anyone give another example of this to understand please?

Praveen Behera
- 444
- 2
- 8
- 17
0
votes
1 answer
How to get Parent id on Related list in salesforce
How to get parent id on custom button click of the related list.
Question Exploration:- when we open the Account detail record page and go in the related tab we have a contact list there and a new button on the contact list tile...when we click that…

Harshit Tyagi
- 1
- 2
0
votes
1 answer
How to filter JS array containing apex list as a result of SOQL?
I have an apex list which returns a result of SOQL.
List List1=[select Name, Phone from Account where Name=:actName];
This method is being called from a JS file of my Lightning Web Component and the result is being saved in an…

Niklaus
- 39
- 1
- 9
0
votes
0 answers
How to properly unload and kill a web component?
im having a simple web component running on my page. By a button click i simply remove the element expecting that the element and the class behind it is getting killed. But actually it keeps running, for example event listeners are still running…

NovumCoder
- 4,349
- 9
- 43
- 58
0
votes
0 answers
refreshApex not trigger when called from parent lwc
I have a button on the parent lwc. When called, it will call a method on the child lwc to perform data update via apex method. Once done, it calls refreshApex to refresh the data on the lightning datatable. RefreshApex will not trigger for some…

Eddie Wong
- 1
- 1
0
votes
1 answer
How can I make a lightning-input-field (LWC) not required?
I am using a lightning-record-edit-form as shown below

Burak
- 300
- 2
- 14
0
votes
1 answer
Field not showing on layout while using Lightning Record form
UniformContractingLWC.html

pravince singh
- 11
- 2
0
votes
1 answer
I tried to build a LWC component to view data but its not working
I tried to build a LWC component to view data, but the data was not showing on UI. i can't get what was wrong with my code.
Html:
…

Abhijith Poojary
- 31
- 1
- 4
0
votes
2 answers
0
votes
1 answer
Refresh records in LWC?
I am using a apex method that returns Map which contain multiple object records. So how can I refresh that records after updating some of them. I am updating them but it is not showing updated value without refreshing a page. Are there any way to…