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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

Refresh LWC after Custom Object standard Edit

On a Lightning record page, I have an LWC that should show changes if they are made when clicking the standard Edit button/functionality. I've been able to achieve this before when I can create a ...
1 vote
1 answer
1k views

How to get Fixed footer (Save/Cancel) for lightning-record-form?

Using Lightning-record-form we get standard save and cancel buttons in UI. But these buttons appear to not have fixed docked footer. User needs to scroll down to see the buttons. I am trying to ...
0 votes
0 answers
21 views

field is not rendering when the custom LWC component is loading

I have a requirement, there is a custom button to edit the account name. It has 2 fields on UI. one picklist "Reason for name change" and another text fld "name change comments". I ...
0 votes
1 answer
12 views

Data Showing on Console but not on Component

if i select one or more than one checkbox then their account records should be show on subscriber component Here is the Code ====HTML==== <template> <lightning-card variant=&...
0 votes
2 answers
3k views

Hiding dates earlier than today on lightning-input field

Is there way to grey out the dates which are less than today using a simple <lightning-input type="date" name="input1" label="Enter a date" ></lightning-input>...
0 votes
1 answer
1k views

LWC HTML not rerendering after object change NOT Solved

I am having a similar issue as the one linked at the bottom, it looks like the answers are claimed to work, however I cannot seem to figure out wth is wrong with my code that seems to be very similar. ...
1 vote
1 answer
50 views

Does LWC Javascript count towards CPU time limit and Heap Size?

I have been using Apex right now to parse the CSV and I am being thrown with CPU time limit error when there are more number of records. Hence, I am planning to move towards LWC JS as the CSV file is ...
2 votes
2 answers
2k views

LWC File Upload component ignores accept setting for drag-and-drop

There is a strange behaviour in LWC File Upload component. There are two ways how files can be uploaded through this component. The user can: Select a file on your system by clicking the button to ...
0 votes
1 answer
908 views

LWC in Experience Cloud not displaying record field values

I have a Lightning Web Component that is using the import {getRecord , getFieldValues } and then displaying for clients in customer community within a LWC; however, the field values are not populating....
0 votes
0 answers
17 views

How to change border color of a Lightning Data Table column based on date value in LWC?

I have a Lightning Web Component (LWC) with a Lightning Data Table that displays data, including a date column. I want to change the border color of the date column to red if the date has passed. I ...
0 votes
0 answers
21 views

Data saves only on the first row in the lightning datatable

I have a lightning datatable with a save event. After i click the save button, the inputted data always saves on the first row of the table, regarding the position of the row that i just edited. ...
0 votes
2 answers
1k views

How to use long date format in LWC

So I've been trying to understand the use of dateTime.longDateFormat in the documentation located here: [https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.create_i18n][1]...
-1 votes
0 answers
14 views

Customise UI Email Component

I am trying to customise email UI component on case object as I want the ability to edit the contents in the template. in the custom component when I import the template it does not have merge fields ...
1 vote
2 answers
2k views

LWC - Preselect all rows in the Data Table

I'm trying to figure out how to pre-select all of the rows in my Data-table. According to this documentation, we can select rows programmatically. However, it does not explicitly show how to select ...
1 vote
1 answer
2k views

LWC Modal Losing Focus

Update 10/25 I have a modal that I am creating when a user clicks on a lighting card. For accessibility reason I need the focus to remain in the modal until the user clicks Dismiss or hits the ...
0 votes
2 answers
680 views

How to show/hide via btn click from parent component?

Show btn is working for this parent to child communication. how to hide the child comp. with same btn?? import { LightningElement, track } from "lwc"; export default class ParentComp extends ...
0 votes
0 answers
21 views

Overriding Upload Files button in Salesforce Related List

Requirement is, asking certain question from user before they upload any files in to the system like it has any sensitive information etc. For that I wrote a custom component with <lightning-input&...
0 votes
1 answer
747 views

How to display the Case Number as a url tin lightning data table

I have created formula field name display eFile which creates a dynamic url for each eFile Number HYPERLINK("https://abc-communityabc.cs93.force.com/cs/s/case/"+Id+"/detail",""+CaseNumber) eFile.js ...
0 votes
1 answer
114 views

Error : remove these Aura components or replace them with Lightning web components: forceContent:fileUpload

I am getting the below error when I try to use the File upload component in flow and place it on the community site. It is working fine when I run this in salesforce org but getting errors in a ...
1 vote
1 answer
994 views

lightning-input-field [Lightning Web Components]

I am currently trying to make a table where I use the lightning-record-edit-form. I am trying to make the helptext icon disappear (without deleting it on the field itself), without any luck.. Can ...
0 votes
1 answer
33 views

How can I dynamically access an object's field value in an LWC template?

I'm really scratching my head here. The below syntax does not work, specifically in "{o[c.value]}" due to "Template expression doesn't allow computed property access". What is the ...
0 votes
2 answers
1k views

how to call another html from existing html in lightning web component

Main.html <template > <button class="btn btn-primary" onclick={selectServiceTemplate}>Add Location</button > </template> Addlocation.html <template > hello this ...
0 votes
1 answer
682 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 ...
0 votes
0 answers
28 views

How can I import Objects and Fields to a LWC in JavaScript?

Hello I'm new with developing on Salesforce, and I am running into a problem when importing my fields to a LWC I created. Here's my example: I have 5 Opportunities created which have 5 different ...
0 votes
0 answers
17 views

custom lwc not showing up in lightning app builder

Lightning web component not showing up on Lighting app builder page. The component previews nicely but doesn't show up Edit: Found the answer, two parts Is exposed needs to be set to true in the lwc ...
0 votes
0 answers
19 views

Floating button in Community page

I am trying to figure out the way, how to add a floating button( which stays always in the same position on the page) To our community page. In this case, it's just a simple button to navigate to the ...
-1 votes
1 answer
22 views

No MODULE named markup://lightning:sharingUtils found : [markup://c:recordShareLWComponent]

How to solve this error? No MODULE named markup://lightning:sharingUtils found : [markup://c:recordShareLWComponent]
0 votes
1 answer
38 views

Lightning Tree grid not Expanding for Self parent Scenario

I am trying to create a hierarchy like structure for my custom object Project which have a custom field called Parent_Project__c. I am facing an issue where the data is returning correctly in JS array....
0 votes
0 answers
29 views

Trying to use Spring '23 RefreshView API from an Aura component to refresh wire data in LWC

I'm trying to use the new RefreshView API introduced in Spring '23 to fire a refresh event from an Aura component to refresh a related list wire in an LWC component (very similar scenario to this ...
0 votes
2 answers
45 views

Show/hide spinner every time @wire is called

I have a lwc with multiple wires that retrieve information and I need to display a spinner while all this calls are being made and hide it whenever they finish. I've seen that you can do this wiring ...
0 votes
0 answers
24 views

'Sorry to Interrupt' error when trying to save lwc

I have recently added a new column in a lwc, 'reported due date', editable, in a lightning datatable. I also created a validation rule, which is called in the save event, but when i click on save i ...
-1 votes
0 answers
23 views

Add spinner when standard record detail page save button click

Lightning Data Service is reactive in nature so when user clicks on standard save button on the record detail page the wire method on getRecord re-executes, and everything works like a charm but when ...
0 votes
1 answer
24 views

Get the page from where the button is clicked

The New standard button in the Salesforce is overriden by the Lightning component (Aura). Now this New button is being used in the multiple places: While creating a contact record from the list view ...
2 votes
1 answer
2k 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 ...
0 votes
1 answer
22 views

Generic Required Field check for lightning-input-field of Child component

I have a child component, in which I'm using lightning-record-edit-form and in that I have lightning-input-field where some of them are required. Now when I'm submitting the form from parent I want to ...
1 vote
0 answers
29 views

Writing an action using LWC that accesses the records selected in a custom object tab list

LWCs that are hooked up as buttons on record pages are working fine for me with: <targets> <target>lightning__RecordAction</target> </targets> both headlessly -...
0 votes
1 answer
816 views

How to detect the LWC form changes on Back button

I am working on gathering the information from the user, once the document details been saved into database, still user can be able to edit the form data at any time. If user click "Back" ...
0 votes
0 answers
28 views

Getting 403 Error using Navigation Mixin to URL in community

While selecting language of choice from UI (onclick), I am fetching the language code from Apex and appending it to the community basePath inside NavigationMixin which takes page reference URL as ...
2 votes
1 answer
58 views

How can I compile a LWC to use it as a standard web component via customElements.define()?

I'm trying to compile a LWC to a standard web component, so that after importing it I could just use it as any standard HTML tag: <html> <script type="module" src="./...
1 vote
1 answer
32 views

LWC get field value from @wire result (single object) from apex query

I've searched for an answer but found none. The answer is probably simple, but I'm tired of trying and not finding a solution! I need to access the fields returned from the query. It does not return ...
0 votes
1 answer
309 views

Salesforce Lightning Locker Not allowing me to get Cookies

I am trying to develop the functionality of cookie settings and Accept Cookies for my Community Users. As per the below new Salesforce functionality https://developer.salesforce.com/docs/component-...
0 votes
0 answers
38 views

How to send a variable from one LWC to another?

For example I have one LWC that has a search bar feature. (Seen with the photo below) Then I have another LWC that's a map. (Seen with the photo below) My question is how would I be able to import ...
1 vote
2 answers
102 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 ...
3 votes
1 answer
1k views

lightning-record-edit-form: display text field as a custom picklist?

I've created a custom object where the user manually enters a locale value (ex: en_US, es). Instead of letting the user manually enter a locale, I'd like to provide the user with a combo box of valid ...
0 votes
0 answers
20 views

Facing issues while using refreshApex on child component when triggered from parent component

I want to refresh data on child component when a form is submitted in parent component Parent comp: handleSuccess(event) { event.preventDefault(); this.template.querySelector('c-...
0 votes
1 answer
823 views

LWC1057: label is not valid attribute for lightning:tab

I am not able to deploy lightning tab getting this error :- LWC1057: label is not valid attribute for lightning:tab Code snippet <template> <lightning-tabset> <lightning-...
0 votes
0 answers
254 views

LWC - Contact lookup input field should get auto populated when account is selected

I created a form using lightning-record-edit-form. When I click on Vendor and Contact it displays all the recent account records and contact records respectively My Requirement is: If I select any ...
0 votes
1 answer
30 views

Report attachment in email

With this code im only able to get a corrupted xlsx file in email. i have attached the image of cvs converted format. public static void SendEmailNotification(string body,string ReportName, Id ...
2 votes
1 answer
714 views

Exiting a screen flow from a screen that contains required input

I have a screen flow with two screens. Screen 1 contains a form with a required field ("Credit Score") and two buttons: Cancel and Next: I would like to give the user the option to exit ...
0 votes
1 answer
37 views

Passing array to lightning-modal is being flattened

I am trying pass in a simple array to a base lightning-modal component. import MyModal from 'c/myModal'; //This is extending LightningModal from 'lightning/modal' options = ['a','b','c']; async ...

1
2 3 4 5
158