Skip to main content

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
11 views

Why Rich-Text Image URL not getting updated in record?

Why before Insert or Update doesn't update the RichText Image URL? To Replicate New Field: Created a new RichText field in case object 'Comments__c' Take a screenshot and paste the image field. ...
1 vote
1 answer
873 views

notifyRecordUpdateAvailable vs RefreshApex vs RefreshView API

RefreshApex works for me so far in almost every case. I'd like to understand why I would instead use notifyRecordUpdateAvailable or the RefreshView API instead. Or am I horribly misunderstanding the ...
7 votes
4 answers
5k views

You can’t remove the following public properties because the component is part of a managed package

I am trying to push a JS file in a LWC Component and am unable to do so with this error lwc/boatMap/boatMap.js-meta.xml: You can’t remove the following public properties: boatId, because the component ...
0 votes
1 answer
880 views

JQuery Datatable in LWC responsive not working

I am using JQuery Datatable in LWC (https://datatables.net/extensions/responsive/examples/) which i can use both in desktop and mobile version . I am trying to achieve the below responsiveness where ...
0 votes
1 answer
826 views

How to populate lightning-datatable depending on which lightning button (with onclick handler) is clicked on?

I created a LeadsContoller with multiple methods each returning a list of leads via a SOQL Query. I created multiple lightning buttons in HTML each with an onclick handler. In the JS file, i imported ...
1 vote
1 answer
927 views

LWC lightning-input-field for a checkbox field in lightning-record-edit-form, the field can only be saved once?

When using for a checkbox field in lightning-record-edit-form, the field can only be saved once. Other fields can be changed and saved more than once. NOTE: a custom checkbox field on Contact was ...
0 votes
1 answer
3k views

LWC add custom data-type checkbox and extending lightning-datatable

I have a requirement where I have implemented the lightning-dataTable with the custom-dataType column checkbox. As you can see in the screenshot, I have a requirement where onCheck of the parent row(...
2 votes
1 answer
23 views

How to pass values into the "LWC CRM Analytics Dashboard" component?

I'd like to use a CRM Analytics dashboard filtered by values from the page it is contained in e.g. the record ID from a details page. The "LWC CRM Analytics Dashboard" component (screen shot ...
2 votes
1 answer
946 views

LWC Continuation SOAP API does not seem to be working

I`m trying to execute Continuation from LWC action. The thing is that I use it for SOAP API. It is a long-time running request, but I have to show a loading spinner until the response will be ...
0 votes
2 answers
869 views

How to call a child LWC method from a parent Aura cmp?

I have an aura cmp(parent) that acts as a container for 2 LWC's(children). I am trying to call the handleAddToDashboard() method in the stockTracker_Dashboard LWC from the StockTrackerContainer aura ...
1 vote
1 answer
4k views

how to deploy lightning message channel in vs code

I have created a lightning message service configuration file (.Xml) and while deploying it on right click of vs code and deploying it i am facing the below error force-app\main\default\...
1 vote
1 answer
29 views

Test LightningCombobox in jest

Im having a lot of trouble trying to read the options coming from a combobox when i select it. Ive tried to move the options to a @track variable making the call for the options just simply return ...
4 votes
2 answers
3k views

Salesforce: Drag & Drop not working in lightning web components or drop events are not triggering

I have a Lightning web component to drag one div into other dropzones (div). But the ondrop & ondragover events are not firing. Here is my code <template> <div class="draggable" ...
2 votes
1 answer
3k views

I can push an LWC component, but I cannot see or use an LWC component in the default org?

Once deployed, I can see the component from the Home page in Custom Code > Lightning Components > Lightning Components, however when I Edit the Sales Page (or any other) it is not under Custom ...
-1 votes
0 answers
25 views

Click on LWC(has URL navigation logic) custom tab, not getting redirected to URL

I have created LWC custom tab in Salesforce. In this, LWC(parent LWC) which calls child LWC. Parent LWC fetches the URL using apex and passes it to the child LWC using the query locator function. ...
3 votes
1 answer
1k views

Test lightning-emp-api

Can we simulate an event subscription in LWC unit test? I have a lightning web component using lighting/empApi like, export default class ExampleComponent extends LightningElement { ...
0 votes
0 answers
20 views

AES Decrypt in Salesforce over 1MB

Has anyone used JS in SF to view encrypted (standard apex encryption) file which is >1MB? I came across this link but unsure if it will work using LWC in Salesforce. Iam looking for similar ...
1 vote
1 answer
1k views

Need to display object label in combobox

I need to display object label instead of API name in the combobox. How to access label of object dynamically? Below is the scrrenshot and code! .JS getCustomObjects({ }) .then(...
1 vote
0 answers
35 views

Imperative Apex in LWCs seems to wait for other Imperative methods to return in Production orgs

I have a LWC with two child LWCs in it. Each child LWC has an imperatively-called method to grab data, however, one of the children's methods takes, on average, a few seconds longer since it calls a ...
1 vote
1 answer
991 views

Error When deploying Experience Bundle to Related to Variations Folder on the Bundle

We are receiving the below error when we are trying to deploy the experience bundle on the community to different Org. What Components we are deploying: Experience Bundle Profiles We add few LWC and ...
0 votes
1 answer
2k views

LWC Lightning-input custom validation for max length, no error message comes on blur

<pre> <lightning-input type="text" label="Enter some text" max-length=10 message-when-too-long="Max 10 characters allowed"></...
1 vote
1 answer
980 views

lightning-quick-action-panel remove scroll using css LWC

I am using lightning-quick-action-panel in the html and the component loads on a button click and it contains a data table. There are 2 scrollbars present and I want to get rid of one .When I ...
1 vote
0 answers
15 views

How to pass parameter from Lightning flow to Lightning Email Template to LWC

I have a requirement to display a list of records in email. Records are constructed from 3 objects. Since it's not possible to use a list in the Lightning template I decided to use LWC in the ...
0 votes
0 answers
28 views

LWC lightning__UrlAddressable Subtab State Error

I have created a subtab component which has a lightning__UrlAddressable target. And I am calling it from another component whose code is given below. The issue which I am getting is that it works fine ...
1 vote
2 answers
2k views

how to pass record id to lwc from custom button on detail page of event object?

I have created a custom button on the detail page of the event object and passed the record id in the URL but I'm not able to get the get that id in the LWC component as you can see in the screenshots....
0 votes
0 answers
22 views

How to fix tall headers in Data Table child component

I created a data-table child component that I reuse throughout my org. I followed Rahul Gawale's tutorial on how to have header wrapping (link here) It worked really well, and now my header's do not ...
0 votes
1 answer
5k views

Lightning Formatted Date Time converts datetime to system settings timezone

I have a lightning formatted date time which has a value of a datetime in Zulu format. And the value changes based on the computer's time zone. For example, I have 2023-01-10T20:00:00.000Z, and it is ...
6 votes
6 answers
12k views

Create new record with default values LWC

how to navigate to new record create a page with some default values as we do in a lightning $A.get("e.force:createRecord") in LWC I have tried the below code, but not working: this[...
1 vote
1 answer
22 views

Problem with namespace referencing in LWC in package deployment

We are trying to deploy our package, but a weird error is thrown: The thing is, in that LWC, we are in fact NOT adding the namespace when importing those fields: import PRODUCTO_FIELD from '@...
0 votes
0 answers
23 views

CSS not loading in LWR static site

I am starting a new brand new LWR static site project. Even though the CSS file is present in the folder, its throwing an error while loading in localhost. You can see from the below screenshot - ...
1 vote
1 answer
62 views

What is the meaning oft the exclamation mark in this graphql query?

Trying to learn how to use graphql in lwc and looking at the lwc recipes repo. What I cant find info on is the relevance of the apostrophe after ‘$searchKey:String’ in this recipe. Can anyone please ...
0 votes
1 answer
2k views

LWC Tree grid ontoggle action triggers onrowselection

This is how I am using treegrid component. When I expand a treegrid row, and then collapse it, automatically onrowselection event is fired, which calls onRowSelection action handler in JS controller ...
2 votes
1 answer
3k views

Unable to update tracked array in LWC

For some reason, the push in the code block below is not updating the array. The console.log statement displays the array with 0 elements. I created a local array variable and pushed to it with no ...
0 votes
1 answer
1k views

Flow Complex Apex Defined

I'm trying to pass an apex defined variable from LWC to flow, the class looks like this: public class Subs { @AuraEnabled public String name{get;set;} @AuraEnabled public List<...
0 votes
1 answer
1k views

Populate input field with data LWC

Hello everybody I am currently working on a Flow that receives the Id from the record where the LWC action is and pass it to the LWC. The LWC is a form that shows some lightning-input and lightning-...
0 votes
1 answer
1k views

Pass parameter to apex class method referenced in trigger through LWC

I have a trigger where I'm calling a method from handler class and I'm passing the trigger.New to that method like this: if(Trigger.isBefore && Trigger.isInsert){ List<Lead> ...
19 votes
12 answers
46k views

recordId is undefined in LWC quick action component

I have created an LWC component for quick action and also defined the @api recordId inside that. But the recordId is undefined in the component when logged. Seems like it is not being passed to the ...
0 votes
2 answers
549 views

Lightning Datatable with custom editTemplate will not show editValue in default template prior to save submission

Between this salesforce guidance and inspiration from this popular playground lwc I've arrived at my near working solution. This screenshot kinda says it all. When I was on row 1, I already clicked ...
6 votes
1 answer
1k views

Can I get all existing Pages for a Community using Apex?

I would like to create a custom component to use in Experience Builder, and this component will allow a configurable navigation to another page. I would like to use a dynamic picklist with Apex to get ...
8 votes
2 answers
4k views

How to dynamically import a module in lwc

I am trying to import modules dynamically in my LWC component. While pushing the change I get a strange error LWC1509: This experimental syntax requires enabling the parser plugin: 'dynamicImport' ...
0 votes
0 answers
31 views

How to fix SLDS updates in new release, issue for tab icon color

I have following code working perfectly with tab icon color brings up perfectly. Suddenly after today's release patch it got failed, Any idea to enable tab icon color ? HTML: <template> <...
0 votes
0 answers
33 views

Rich text with image inside is not displaying in Lightning record page

I have rich text area on lightning record page with logo image. Image is stored in static resource as public. This component is displaying in all lower env but not in production. Verified in prod ...
0 votes
2 answers
30 views

How can I check if a variable is declared in "this" or not?

I am developing a function to assign a value to a property of this in Lightning Web Components (LWC) by passing its variable name. Additionally, I need to raise an error if the property is not ...
0 votes
0 answers
25 views

Phone number with flags are not visible on Community pages Salesforce LWC

I want to show phone number with flags like that: But the flags images are showing like that import { LightningElement } from 'lwc'; import flagTelpicker from '@salesforce/resourceUrl/flagTelpicker';...
0 votes
0 answers
9 views

SLDS Email Docked Composer not displaying complete composer

We are creating a create send email component which is replica of standard email component due to customer requirement. So created a custom button at LWC component, On click of the button email ...
0 votes
0 answers
14 views

Test class to cover 75% code coverage , getting fatal error for the codes [duplicate]

Test coverage for the below Apex classes are not enough, getting errors while deployment. public class AccountDiscountsController { public Account accountRec { get; set; } public String accId { get; ...
0 votes
1 answer
2k views

dynamically Change the vertical tab LWC

How to change vertical tab dynamically in LWC Html <div class="slds-vertical-tabs"> <ul class="slds-vertical-tabs__nav" role="tablist" aria-orientation="vertical"> <li ...
-1 votes
0 answers
20 views

Experience Cloud Shows Single Sign On Error When hyper link is clicked

I have a LWC app that works in both Salesforce lightning and Experience Cloud. One key feature of component is to redirect users to a record page when a link is clicked. This works flawlessly in ...
0 votes
1 answer
2k views

How to fit my lightning page to screen height?

I have a lightning page (accessed via Lightning Component tab) which display a custom search box and a lighting map component. The idea is I would like the map to fill the screen (minus the search box ...
0 votes
1 answer
1k views

Sending an event when window.location.href changes

My setup: I have a LWC which is placed in Shared Footer, so I don't have to add it manually on every page. This component is responsible only for sending events. What problems do I have: I need to do ...

1
2 3 4 5
176