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
1answer
39 views

Add data to query results to LWC

hoping i can get some help on this one: I have an Apex class where im running a SOQL query: public with sharing class TestClass { @AuraEnabled public static List <sobject> getFreqLWC(String ...
0
votes
0answers
28 views

LWC that implements Power BI JS is throwing an error

I have a LWC that implements this Power BI JS module. Here is the HTML portion of the LWC: <template> <div data-id="embed-container" style="height: 480px" lwc:dom="...
0
votes
1answer
29 views

Asynchronous JS and LWCs

This is just a question to help my understanding of what is going on under the hood. If I write a simple JS file to fetch data, like below, I can call .then() and provide the name of the function that ...
0
votes
0answers
22 views

to get the Value from LWC in Middle of Conversation of Einstein Bot

Used LWC in Einstein bot in middle of a conversation in which user input in the text box of LWC. whatever user input in LWC wants to get that value and show on bot-message how can do that?? so if user ...
1
vote
1answer
75 views

I want to cover the onMouseover event in JavaScript by writing JEST test case in LWC

I want to cover the Jest test for onmouseover event for this .tried with few approrch ,seems like its not working. <template> <div class="consumer-container" if:true={showFlags}&...
0
votes
0answers
50 views

LWC Apex Refresh not working

I have been struggling to understand why my HTML is not rendering Fresh Stream of Data using Apex Refresh. I've used the cacheable method in Apex. @AuraEnabled(cacheable = true) public static ...
0
votes
1answer
44 views

Promise Implementation within LWC

I have a Lightning Datatable with row actions. Clicking on one the row actions need to make an external callout and get values for another function which dispatches an event with those retrieved ...
0
votes
0answers
18 views

getting Invalid icon name utility error in inspect(console) and also getting showtoast error

import { LightningElement, track, wire } from 'lwc'; import getApartment from '@salesforce/apex/appApartmentDetailsClass.getApartment'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'...
0
votes
1answer
11 views

Conditional displaying error message in Lightning Accordion

I would like to display an error message regarding on JS promise. My code is this: HTML: <template for:each={test} for:item="test"> <lightning-...
1
vote
1answer
33 views

Can you write a Custom Property Editor for a Flow Invocable Action with a list property?

I have an Apex Invocable action that takes a list of values in each request. Can I write an LWC Custom Property Editor to configure that list? Here's what I've tried: Apex Invocable Action (obviously, ...
0
votes
0answers
25 views

LWC in Lightning scheduler for community page

I am using a LWC component in Lightning scheduler flow(in mid of a screen flow) and that lightning scheduler will be exposed via a community page. That particular screen(which contains LWC component) ...
1
vote
0answers
28 views

Salesforce Community: Send event from window to LWC

I'm working on the LWC that sends an event to Google Tag Manager via window.dataLayer.push(). I have the Lightning Locker service enabled, so I cannot access the window property fully. I can push to ...
1
vote
0answers
23 views

How Can Dates From an Org and a User's Personal Machine be Reliably Compared to One Another (LWC)?

I have had some trouble comparing dates retrieved from an org and using them in a Lightning Web Component in order to tell whether or not a certain record has 'expired' in order to display said ...
0
votes
1answer
54 views

LWC HTML not rendering child element again when track variable is changed

I want child LWC to render again when the track variable is changed. When I am passing the custom event from the child component to the parent component and trying to manipulate the track variable on ...
0
votes
1answer
24 views

LWC div id coming with extra "-0" when loaded in a Salesforce Community

I have run into an issue with LWC and Salesforce Communities in which the id of a specific div contains an extra "-0" at the end when loaded in the browser. The code in the lwc contains the ...
0
votes
1answer
41 views

Unable to create record through LWC

I have been trying to create an account record through LWC but I am unable to do so. Can anyone identify the issue here. Please find the code snippet below: Markup: <template> <lightning-...
0
votes
1answer
53 views

not able to add LWC cmp on the app page

try to add this lwc cmp on a page but it is showing an error and not adding to the page. Action.prototype.finishAction Error [Error in $A.getCallback() [p.navigatiommixin is not a function] Callback ...
0
votes
2answers
29 views

How to console.log a List of results from SOQL

Apex @AuraEnabled(cacheable=true) public static List<Object__c> getLocation() { return [ SELECT Location.a__c, Location.b__c, Location.c__c, Location.d__c FROM Object__c ...
0
votes
1answer
37 views

Static Resource Stylesheet in Head Markup of Experience Builder Site

I am trying to link a static resource global css file to the head mark-up. The static resource is loading in the networks tab, but it is not applying the styles to my Aura and LWC components. https://...
0
votes
1answer
29 views

Pass selected Object to Child

I have a for:each for my opportunities. When one of the opportunities are selected I want to set a variable to contain that specific opportunity. I know I can only pass a string so I can't just pass ...
0
votes
1answer
94 views

File-Upload Standard LWC Component not working in Community

I have placed a File-Upload component, on my LWC, onto a Community page. I keep getting a Javascript error when I try and test it in preview mode. The error is "l.createComponent is not a ...
0
votes
1answer
32 views

How can I tell if a component received slot content?

I have a component with an optional slot, and I need it to behave slightly differently if it received content in the slot vs. if it doesn't. How can I programmatically determine if a component ...
0
votes
0answers
31 views

Lightning record edit form and slots

Is there a way to intergrate slots and lightning record edit forms. To allow customisation of components in the buidler. In the code below I have made a Lightning record edit form and want to place a ...
1
vote
2answers
47 views

Could Not Find module "lightning/ariaObserver" LWC OSS

I am trying to implement a project with LWC OSS, when trying to import lightning-input I am facing the following error. I tried to import the lightning-button and I was able to import the same ...
0
votes
1answer
58 views

same LWC component to be fired on a button press [closed]

I have developed a LWC component for stopwatch wrapped in Aura component which I use I Utility bar. The component is working great. I am currently stuck at a part where i need a button, on the button ...
0
votes
1answer
44 views

Lightning Message Service doesn't work between community pages

I have two Lightning Web Components. One is on Community Page #1, the other is on Community Page #2. The first LWC creates a record and then navigates to the second Community page. I need to send ...
0
votes
2answers
78 views

Overide CSS standard component LWC

I have a simple lightning-vertical-navigation. I am trying to change the text color of the lightning-vertical-navigation-item but the css overide does not seems to works. Is there a way to do that? ...
3
votes
2answers
94 views

Multiple Apex Methods call - Imperatively

UPDATED: This question also helped me understand better. I have few apex method calls imperatively and its working as expected but I'm not sure if there is a better way to handle or has any pattern to ...
-2
votes
1answer
20 views

how to refer lB2B_Checkout_finalCartItem child name to parent lwc [closed]

</c-l-b2-b_-checkout_-final-cart-item> I used this for child name reference in parent, it gives error /c/lB2B_Checkout_FinalCartItem/lB2B_Checkout_finalCartItem.js:0,0 : LWC1010: Failed to ...
0
votes
0answers
12 views

Is it possible to get the url or page reference from navigationMenuBase menuItems?

In community builder I have set up a navigation menu, and I know in Aura I can fetch those items using navigationMenuBase and via JS have it navigate to those pages selected. I'm wondering if there is ...
1
vote
1answer
34 views

Opening VFPage or Lightning Component via button

We are looking into greater view customization for our standard object detail pages. For instance we'd like the user to be able to decide if they'd like the on page popup form, or the full page form ...
0
votes
1answer
42 views

Unknown type specified in package.xml

I have the following package.xml <?xml version="1.0" encoding="UTF-8" standalone="no"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> &...
1
vote
0answers
52 views

Remove default LWC Tooltip "This property supports using an expression to define its custom label"

In our organisation we have some LWC with configurable fields in the XML As you can see, some of them have description and others have not. Even for the ones that have a description, the help text ...
1
vote
0answers
21 views

LWC with Leaflet JS >> Mouseover not working as expected in L.geoJson

I'm working with Leaflet.JS in a Lightning Community to render a world map. So far everything seems to be working right, but something that I'd like to do is to have the name of the country that the ...
0
votes
1answer
65 views

How to format a CURRENCY type field in a datatable in LWC?

How to format a CURRENCY type field (named "Amount") in a datatable so that there are only 2 digits at the end of the number after the dot (in the fractional part)? The table displays an ...
0
votes
0answers
40 views

Modal Popup not showing properly on button click from mobile device - LWC Salesforce

I have added separate modal(s) on 'Void, Track, View, Print' buttons [Image 1] , when checking from BROWSER all modals are showing/working properly , but when checking the application on mobile ...
0
votes
1answer
24 views

LWC Data Table not getting refreshed on click of delete button

LWC Data table is not getting refreshed on delete of a row. code below: import { LightningElement,wire,track,api } from 'lwc'; import distProfileShareList from '@salesforce/apex/...
0
votes
0answers
43 views

Changing Owner within LWC

I'm finding that it's impossible to invoke a quick action from within an LWC and it also that lightning-input-field does not support OwnerId. Does anyone know of a workaround that would allow changing ...
0
votes
0answers
40 views

LWC Pulling Object RecordTypeIds

I am trying to get all of the record types for a specific object so I can use them to filter data in my LWC. I import the object and use a wire to get the object info without issue. The console.log ...
0
votes
1answer
39 views

Compare Array of objects in LWC

I have my old results in result1 and updated values in result2 . If both ids from the 2 arrays are same then i want to change the new value from result2 in result1 var result1 = [ {id:1, name:'...
1
vote
1answer
23 views

Lightning Web Security - Apex response object manipulation - non backward compatible

When using Lightning Web Security architecture it seems like objects retrieved from Apex methods cannot be modified anymore. It affects backward compatibility when enabling this feature. Example: Lets ...
0
votes
2answers
44 views

Need to to capture feedback(text) on click of a Like & Dislike button in Communities [closed]

Has anyone developed an aura cmp to capture feedback on click of a like & dislike Button. I found an appexchange package for this but it needs tweeks to fulfil my requirements, Unfortunately the ...
0
votes
0answers
12 views

Possible To Use a Whole Number For <lightning-formatted-number format-style="percent">?

I'm using a LWC datatable with an editable column that represents a percentage. This is for an order price adjustment - for example if the user wants to adjust the price of a line item to 50% of the ...
0
votes
0answers
41 views

How to get URL parameter from force.com site in LWC?

I have created an LWC that takes the recordId from the URL. https://myurl.lightning.force.com/lightning/n/invoice?c__recordId=a0B1q00000Jy2ZeEAJ Now I have added the LWC in the aura component and ...
0
votes
1answer
14 views

getting error while adding cmp "You cannot have device specific size attributes for <lightning-layout-item> component without specifying the size attr

<template> <template if:true={apartmentFound}> <lightning-layout multiple-rows> <template for:each={apartments} for:item="apart"> <...
0
votes
2answers
19 views

Aligning checkbox-group in two columns

I have created checkboxes using checkbox group the checkboxes are in single line I am trying to align in two columns but I have not succeeded. <lightning-checkbox-group name="Checkbox Group&...
0
votes
1answer
46 views

delete a record based on the name in LWC

I am trying to delete the record from the array based on the name but am not able to fetch the name in js and I could see 'undefined' in my console. I have highlighted the line which is used to get ...
1
vote
1answer
43 views

Highlights Panel never shows action icons?

I want to check if I'm missing something or if the "Highlights Panel" component that allows custom actions to be added just does not (by design) show custom action icons. I assume the latter;...
1
vote
1answer
49 views

Is there a way to embed an lwc (which I create in my org) into another LWC which is from Managed Package?

I have a Managed Package with several LWC's . And I want to create another LWC , in which my clients will have possibility to put their LWC. So I need some container in my Managed LWC where I can put ...
1
vote
0answers
54 views

LWC Flow Control - Finish throws exception

THE CONTEXT: I am creating an LWC as a screen flow element. The LWC is very simple, it displays in a radio button group all of the existing Opportunity record types. Once the user selects a record ...

1
3 4
5
6 7
117