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
12 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. ...
  • 9
0 votes
0 answers
13 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 ...
0 votes
0 answers
16 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
25 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
0 answers
26 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 ...
  • 1
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
17 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 ...
  • 29
0 votes
0 answers
26 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 ...
-1 votes
1 answer
20 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
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 ...
  • 9
-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 ...
  • 2,465
0 votes
2 answers
44 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 ...
  • 825
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
1 answer
21 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 ...
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 ...
  • 1
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 -...
  • 133k
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
0 votes
0 answers
19 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-...
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 ...
  • 1,467
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 ...
  • 350
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 ...
0 votes
0 answers
12 views

LWC how to jump from a modal to another

I would like to achieve, that from an open Modal in LWC after a radio button selection I can jump to another LWC componant that opens a modal. is there a way to achive this? I have seen some solution ...
  • 27
0 votes
0 answers
23 views

LWC click event listener only capturing clicks within my utility component

I have an LWC utility and would like to capture clicks not only in the utility itself but anywhere on the webpage. I have an event listener which works to this effect in Chrome. However, in Firefox, ...
0 votes
1 answer
22 views

Page updated using boolean

This code is for a Lightning Web Component that displays a bar and line chart . The graph displays the volumes for a year selected from a drop-down list. The component also uses a button to refresh ...
  • 11
0 votes
0 answers
24 views

LWC component on record page does not refresh when flow completes

I have a LWC component with three tabs and a quick action button added to an opportunity record page. The quick action button runs a flow and creates or updates a record that would be linked to the ...
  • 591
0 votes
0 answers
22 views

Can't fill lightning input rich text with email template body LWC

I'm developing an LWC which sends an email on a case detail page. The subject and the body of the email is automatically filled by subject and description of the case. I want also to be able to ...
0 votes
0 answers
23 views

Showing html tags though lightning formatted rich text used

I was trying to fetch the data (i.e)body field(Rich text field) of the news content type of CMS and display it using lighting formatted rich text but still, the information shows with HTML tags. ...
-1 votes
0 answers
24 views

How to display picklist as combobox in dynamic datatable in lwc

How to display picklist as combobox in dynamic datatable in lwc (not in static datatable)
0 votes
0 answers
34 views

Show Toast message when record got created using page layout

I want to show toast message whenever a record is created using page layout. for example if a child record is created and due to its creation there are some modification happen in its parent record. ...
0 votes
0 answers
31 views

how to remove record from knowledge article

i have made lwc component where i want to remove record from knowledge article but it is showing null pointer exception. Firstly i am changing the owner and assigning to user who is log in/ performing ...
0 votes
0 answers
18 views

Edit lightning page programatically

Is there a way I can add/remove a specific LWC from all lightning pages programmatically? My use case is adding the LWC from my managed package to the Account detail page(on installation), and ...
  • 941
0 votes
0 answers
16 views

Can we change Einstien bot's Input text field as per company branding, using LWC or Aura

I have a SFDC Einstien bot, but the input box used in my bot is a simple text field, i want it to accept voice and use that to communicate with the bot. So a voice input can be converted to text and ...
1 vote
2 answers
101 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
37 views

LWC seems to be interfering with history stack when using window.history.pushState()

I have a very simple component to demonstrate this issue. HTML: <template> <button onclick={push1}>Push 1</button> <button onclick={push2}>Push 2</button> <...
0 votes
0 answers
22 views

LWC - Wire pass dynamic ids to get records method [duplicate]

In LWC js i am trying to dynamically pass the ids for getting records of a object. if i hard code records id like this it works recordIds: ['0687h000002Jim0AAC','0687h000002Jim5AAC'], but if try ...
  • 7,705
0 votes
1 answer
26 views

javascript filter child object fields

I have this JSON that I'm filtering js this.filteredMisc = this.missions.filter( mission => misc?.Name?.toLowerCase().includes(evt.target.value.toLowerCase()) ...
  • 593
-1 votes
0 answers
17 views

How to create EventRelation record using LWC?

I have an lwc Event record Creation page, in which I also want to let users to add Attendees like we have in standard event creation pages. Is there a way to get that attendees field using lwc?
2 votes
1 answer
57 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="./...
0 votes
1 answer
34 views

How do I check if LWC component has a public method

I have a form with inputs being either standard LWC inputs or custom lookups. I want to validate the form and report error back to the user. I use this.template.querySelector to get the inputs and ...
  • 1,161
0 votes
1 answer
30 views

How to get logged in User's PermissionSetGroup id in LWC?

I want to fetch the PermissionSetGroup assigned to current logged in user. I try to use getRelatedListRecords function from lightning/uiRelatedListApi. I have implemented the following code but I am ...
-2 votes
0 answers
61 views

I have a very simple LWC component with a button that calls an Apex method . Unfortunately, I'm not able to reach to Apex class

HTML <template> <lightning-button variant="brand" label="Send Email" onclick={sendEmail}></lightning-button> </template> Javascript import { ...
0 votes
2 answers
57 views

Unable to install lwc-dev-server / run sfdx force:lightning:lwc:start

I am trying to run LWC in local. I was able to install with errors C:\WINDOWS\system32>sfdx plugins:install @salesforce/lwc-dev-server Polling for new version(s) to become available on npm... done ...
  • 101
0 votes
0 answers
21 views

Step-by-step of Adopt the Salesforce ICU Locale Formats

Is it any automatization existed (from Salesforce?), that we may run in our ORGs to check all that: format(), parse(), @locale, import * from @salesforce/i18n/* to cover the whole CODE (Apex, LWC, ...
0 votes
0 answers
15 views

How to close a SF Case from a Canvas APP?

What is the code (Canvas SDK) to be used in the Canvas APP web application to change the status of a CASE in SF? Or the only way is to rely on REST API (and consume the API call quote)? Any advice ...
  • 13
0 votes
1 answer
28 views

Lightning tab with LWC name stuck in "Loading"

I created a lightning tab with a LWC and the name of the tab is stuck in "Loading.." in apps such as console, when I search about that, I saw that the most used way to correct this is put ...
  • 19
3 votes
1 answer
88 views

LWC: Getting original element that dispatched event that bubbles

I'm encountering some behavior in LWC that runs counter to my understanding of Event.target -- namely, that it is supposed to represent the DOM element that originally dispatched the event. Here is an ...
0 votes
0 answers
15 views

How to filter dates in dataraptor using literal dates

How can I make this work? or how to filter the date by a range?
1 vote
1 answer
31 views

How to redirect to start of the flow using LWC embedded in the same flow

I wanted to redirect the user from LWC. LWC is embedded in the same flow, I tried the following, import { FlowNavigationStartEvent } from 'lightning/flowSupport'; handleGoToStart() { const event = ...
1 vote
1 answer
39 views

How do I mock a child LWC in a parent's Jest Unit Test?

I have two components that are in my app: parentComponent childComponent. 'parentComponent' includes 'childComponent' as a component. E.g: parentComponent.html <template> <c-child-...
-1 votes
1 answer
20 views

Customizing a Flow's Finish Behavior

I've been trying to set a flows finish behaviour in lwc and it keeps restarting I see from the documentation I am meant to set the flowFinishBehavior attribute but how do I exactly set this? or at ...

1
2 3 4 5
158