Questions tagged [lightning-web-components]
This tag is for questions related to JavaScript, CSS, or Markup when used in the Lightning Web Component (LWC) programming model, or for questions of interoperability between LWC and the original Aura-based lightning components.
8,920
questions
0
votes
1
answer
29
views
Navigation to list view [duplicate]
Am trying to navigate to custom list view from lwc button.
Here my code :
HTML :
<footer class="slds-card__footer">
<lightning-button variant="brand" label="...
2
votes
2
answers
1k
views
LWC Issue Using CSS in Apex-generated HTML String
I am generating an HTML string for a table using Apex then passing that into a lightning web component using the @wire decorator. In my HTML file, I am using:
<lightning-formatted-rich-text value={...
1
vote
2
answers
1k
views
Can you navigate from one LWC to another?
I can't find anything that would allow me to navigate from one LWC to another. I have a search LWC that returns a list. From a record returned in the list, I want to open a LWC for that record and ...
0
votes
1
answer
25
views
How to get a lightning-datatable's width correctly setup for horizontal scrolling?
When a related list is configured in a page, the table showing the related list values starts with this markup:
<div lwc-392cvb27u8q="" class="slds-scrollable_y" style="...
2
votes
1
answer
2k
views
getRecordNotifyChange is not working all the time
Whenever changes happened in child record i want to update a field in my Parent.Parent field should be updated without refreshing the UI. So i have created a trigger in my child ,updated my parent ...
3
votes
2
answers
2k
views
Supporting guest user file upload on an LWR Site (up to 20mb)
I'm trying to build a simple public-facing web form on an LWR Site. One key requirement is for users to be able to upload a file, but I'm facing some heavy obstacles:
lightning-file-upload is not ...
0
votes
1
answer
18
views
LWC - Community redirect to Home not working
I am modifying a lwc in a community in order to redirect to the Home page when you click on a button. The code is the following:
CommunitySiteLogo.html
<template>
<img src={imgLogo} alt=&...
2
votes
1
answer
3k
views
How to handle standard toast events in LWC
For lightning I used a handler for force:showToast event to capture toasts for edit/new actions on standard pop up when a record was edited/inserted. I would like to do the same in lwc.
I added a ...
-1
votes
1
answer
17
views
How can i preselect all the values as default in lightning dual list box
Hello i have a similaire question i'm new with js
<lightning-dual-listbox
name="SIRET"
id="listAtt"
label="Choisir les piéces jointes"
...
0
votes
1
answer
1k
views
LWC - catch block is always getting executed in loadscript LWC
My static resource
Trying to load this script using loadscript. Below is my code...
import { api,track,LightningElement } from 'lwc';
import {
loadScript
} from '...
0
votes
1
answer
1k
views
Hide an LWC component based on custom property. (Set component visibility based on custom field in component)
I have an LWC component on the Lightning App Builder. I saw that we can use "Set Component Visibility" feature to hide the component but it only works for standard Record/User/Permissions ...
0
votes
1
answer
26
views
NaviagtionMixin within Child Component or Lightning Modal Links to JavaScript Void
When using a lighting modal or child component using NavigationMixin and lightning navigation, GenerateUrl does not work it seems. The result in the promise returns null. Example test code I used ...
1
vote
3
answers
6k
views
How can I load jQuery in LWC?
For the convenience of the user, I'm implementing the requirement of katakana is automatically entered when entering hiragana or kanji in Japanese using this JavaScript library.
You can check the ...
1
vote
1
answer
4k
views
How to set dynamic default values in lightning dual list box
I want to set dynamic default values in lightning dual list box
Lwc code
eFile.html
<lightning-dual-listbox name="Select Fields to display"
label="Select Fields to display"
...
0
votes
4
answers
1k
views
How to remove expected date format in lightning-input element?
EDIT: This is a duplicate question. Answer here if you have a good answer: lightning-input type date, hide date format below the field
With the Winter '25 release there is an update that adds the ...
0
votes
2
answers
58
views
In LWC, how to put up spinner while long running Apex method runs
I want to put up a spinner while a long-running operation runs when a button is pressed. I try conditionally rendering via a member variable set in them method that handles the button without success....
-1
votes
0
answers
15
views
LWC canvas touch events are not working in mobile (IOS, Android)
We have implemented custom component and added a canvas element to capture signature. This is working perfectly in laptop and desktop devices, however its not working in mobile devices (IOS, Android).
0
votes
1
answer
24
views
how to fetch the details of selected rows from a lightning data table when we have multiple lightning data tables availabe in lwc
I have 2 lightning data tables in my LWC. Under those tables, I have 2 buttons respectively. With one click of a button, I want to fetch the selected rows of the targeted lightning data table. I was ...
2
votes
1
answer
2k
views
jsPDF and Salesforce Lightning Web Component
I'm trying to create a Salesforce Lightning Web Component to create a custom Quote PDF using jsPDF. I mastered to use the external chart.js library with uploading it as a static resource, but when I ...
0
votes
0
answers
23
views
Remove help text from lightning-input type date [duplicate]
Woke up today and all of my lightning-input type date components now suddenly show the date format under the input field. The picture below illustrates this. Any suggestions for a fix?
0
votes
1
answer
39
views
+50
Salesforce LiveChatTranscriptEvent trigger is not working when there is a new message
I am trying to implement a custom LWC for new message event using platform events. In order to do that, I am trying to trigger an event using the trigger but the Trigger is not triggered when there is ...
0
votes
1
answer
845
views
Apex is throwing error but LWC is not catching and displaying the correct Toast message
I have created a validation rule on Order Product Object, it is working as expected on the record page. While making changes from LWC, error message is not shown, instead a success message is showing ...
1
vote
1
answer
2k
views
How to get Formula Description for LWC
The "MailTempRenewalHosyuStart__c" in Contract object is formula of text.
I wrote as below.
"★Detail★
"&BR()
&BR()
&( Field4__r.Name) &BR()
&TEXT( C__Contact__r....
0
votes
1
answer
2k
views
How to Stop A Timer in a LWC Component?
I have an LWC component that starts a timer (see timer code below).
This works just fine but the LWC is on a record page. When I navigate to several records sequentially the timers multiply like ...
0
votes
1
answer
2k
views
Lightning Card Slot Footer
I am trying to add a checkbox next to the save button. The save and the cancel buttons are inside a lightning card P slot ="footer"
The checkbox does not appear in the same row as that of ...
0
votes
1
answer
889
views
LWC Quick Action - Refresh Page after Submitting for Approval through APEX?
I have an approval flow setup to update fields on the object once it is fired. I created a Quick Action that is an LWC that will validate fields prior to submitting. If the record passes the code will ...
0
votes
0
answers
7
views
LWC launch Omni Channel Email & Phone utility bar actions
How can I launch the Omni Channel Email & Phone utility bar actions?
I have checked the lightning/platformUtilityBarApi and lightning/navigation, but I couldn't figure out how I can launch the ...
0
votes
0
answers
49
views
RecordId Undefined In LWC
I'm trying to perform simple update on record with LWC button. But i can't get record id.
Here's full code
import {api, LightningElement, wire} from 'lwc';
import {getRecord, updateRecord} from "...
3
votes
4
answers
3k
views
Unable to save on handleSubmit in a lightning-record-edit-form component
I'm having an issue trying to save a record I'm creating using LWC.
I have a "lightning-record-edit-form component" tag with its "onsubmit" and "onsuccess". Both execute properly if I let them do ...
1
vote
1
answer
1k
views
loadScript fails in Community: Failed to load resource: the server responded with a status of 503 (Service Unavailable)
I am loading a JS file in a LWC with:
import { loadScript } from "lightning/platformResourceLoader";
connectedCallback() {
loadScript(this, "/resource/simpleTest")
.then(...
0
votes
2
answers
908
views
Displaying a picture to a record it was just uploaded to
I have created an LWC for a file uploader to upload pictures to a record, what I want to do next is display the photo that was just uploaded to that record automatically, Does anyone know how this is ...
1
vote
2
answers
1k
views
LWC: is the Standard Tab component firing app events when switching tabs?
Is there any hidden event available to be subscribed in order to capture when the user selects a tab from the standard tab component(added from the app builder)
Inside each tab, we've placed our own ...
0
votes
2
answers
3k
views
Using Navigation Service to redirect user to a Case Object Page in Community site
while I understand how one could navigate from one Standard Page to another within an LWC component, navigating to Object Page within a Community Site is very troublesome to me. I've seen this example ...
0
votes
1
answer
1k
views
Overriding edit button with LWC and returning to original location
We are working to override the standard edit button with a LWC that will check if the user has edit access or not before proceeding to the edit page.
Basic functionality is working but one challenge ...
0
votes
1
answer
2k
views
Get the record Id from one LWC and use it in another LWC
Everyone!
I'm currently practicing LWC.
I made an LWC1 that will create a new order (Order Object). And also created a different LWC2 to add product to the order created. Sadly, I can't add a new ...
0
votes
1
answer
8k
views
How do you to use the lightning-formatted-rich-text LWC component to display Salesforce Base64 Notes (VersionContent)?
Salesforce Note content is stored in ContentVersion.VersionData as Base64. The LWC lightning-formatted-rich-text just displays BLOB(n bytes).
The SOQL in Apex looks like this:
notesList = [select Id,...
1
vote
1
answer
3k
views
Unable to select my custom login page from experience builder page at community's login& registration setting
I need my custom login page for community because standard login page can not freely customize. I created custom login page with aura component and embedded to my custom login page called as AnyTest ...
1
vote
2
answers
3k
views
How do you format LWC´s datatable date picker´s input display date?
I have an editable date column in a lightning datatable. I need to format dates in that column even for the date picker.
Is there a way to show the string "28 Oct 2020" in the format dd/mm/...
0
votes
1
answer
1k
views
How to save selected multiple Lightning check box values in the backend and show them on UI?
I need to save selected multiple values from lightning-checkbox-group in the backend, which should show on the UI after refreshing the page.
I am able to select values but not able to show them in the ...
0
votes
3
answers
2k
views
LWC: Issue with lightning-quick-action-panel - Multiple scroll bars
I am trying to use the lightning-quick-action-panel to create a quick action button which shows some fields for user to Edit. My issue is related to multiple scrollbars on the page.
my HTML file:
<...
1
vote
1
answer
2k
views
Conditional Rendering of a Form Based on Case Status LWC (if:true)
I am trying to get a form to render conditionally based on the Status value of a case (don't ask me why I'm doing this just trying to learn about attributes, @wire, etc.). Any help would be ...
0
votes
0
answers
20
views
Customize upload files from Case related list
I want to customize the Attachments component that is in the Case related list. Is it possible to insert a checkbox button before the user clicks on upload files in this standard component? Any ideas?
4
votes
2
answers
3k
views
lightning-input type date, hide date format below the field
NOTE: THE QUESTION DISCUSSES ONE FEATURE THAT IS IN WINTER '25
Today one of the Sandbox I am working on got updated to Winter '25. With these come some changes to LWC components. The one I just ...
-1
votes
0
answers
45
views
Change the icon for the lightning-accordion in LWC
I am trying to replace the arrow sign in the lwc accordion with a plus when opened and a minus when closed.
A previous question, indicates that we can modify using CSS, but it is not working for me ...
12
votes
2
answers
10k
views
LightningComponentBundle "Not available for deploy for this API version" error
I receive a strange error "Not available for deploy for this API version" for deploying LightningComponentBundle by sfdx force:source:deploy command or by VS Code Menu Item "SFDX Deploy Source To Org"....
1
vote
0
answers
27
views
Microphone Access in Salesforce Mobile (LWC)
I want to access my microphone from LWC, which I’ll be running on the Salesforce Mobile App.
This is my code:
async startRecording() {
try {
this.stream = await navigator.mediaDevices....
-1
votes
1
answer
28
views
Change label name for same Lightning Web Component in Screen Flow
I am trying to use same LWC component in my flow for three different fields for validation purpose. It's showing First Name three times as shown in the picture. How do I show First Name, Last Name and ...
1
vote
1
answer
299
views
Winter '25 release : onclick on lightning-helptext no longer works?
I have code like this :
<lightning-helptext if:true={iscopyenabled}
icon-name="utility:copy"
content="Copy"
size="small"
onclick={handlecopy}>
</lightning-...
0
votes
1
answer
3k
views
How to set maxlength for lightning-input-rich-text
How can we limit the number of characters entered in rich text field lightning field
<lightning-input-rich-text
value={myVal}>
</lightning-input-rich-text>
Is there any ...
0
votes
1
answer
42
views
Address Autocomplete in LWC
I implemented lightning input address with show-address-lookup = true on my community page, and it was working perfectly two days ago. Now, the search bar isn't showing only the address fields are ...