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.

1,646 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
1answer
570 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 ...
2
votes
0answers
282 views

LWC: Master-detail field default value in Lightning-record-form

Is there a way to assign default value for record's master-detail field on LWC component "lightning-record-form" ?
2
votes
0answers
957 views

Flexipage - LWC with no header

I have added a LWC component onto an APP page: <?xml version="1.0" encoding="UTF-8"?> <FlexiPage xmlns="http://soap.sforce.com/2006/04/metadata"> <flexiPageRegions> <...
2
votes
1answer
1k views

LWC datatable column width responsive

I have a LWC component (NOT Aura) that has a datatable with just one column. By default, the width of that column is 1000 px, which is way too small. Using max-column-width="4000" or similar on the ...
2
votes
0answers
904 views

Get Child Records with getRecordUI in LWC

Trying to child records through the getRecordUI @wire(getRecordUi, { recordIds: '$recordId', childRelationships: 'PREFIX__OBJECT__c.PREFIX__CHILD_RELATIONSHIP_NAME__r', layoutTypes: 'Compact', modes:...
2
votes
0answers
1k views

Use value retrieved from getFieldValue as argument to apex call in LWC

What I am looking to achieve is for a component on a Lightning record page to take the ID of the record in context, get the value of a field upon that record, then feed that into an Apex method to ...
2
votes
0answers
394 views

Push failed : Invalid type: Schema.object__mdt Error message when pushing the code from VS Code to Scratch Org

I have create a custom metadata object with records in my DevHub org and i write an apex method that get the custom metadata records but i got an error message in my terminal when i try to push my ...
2
votes
1answer
129 views

Update sObjects in .sfdx/typings

I have a VSCode SFDX Project that we use to develop LWCs, and we recently changed some object names in the Org and now I can't upload anything to our Org. I found that there is a command to refresh ...
2
votes
0answers
158 views

Why we have two data model static and dynamic in lwc to refer in metadata aware component

In base lightning component in LWC we can refer data model static or dynamic. Static ensures referential integrity whereas dynamic does not. Is there any other difference between these two? Which ...
2
votes
1answer
981 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 ...
2
votes
0answers
2k views

Invalid reference of Static Resource in LWC Salesforce

I am trying to use Static resource inside the lightning web component. while importing getting this error:- "Invalid reference SDFCImages of type resourceUrl in file StaticResourceDemo.js" here how ...
2
votes
1answer
267 views

How to trigger analyticsInteraction aura component from Lightning web components?

How to trigger analyticsInteraction aura component from Lightning web components? Below is the code to trigger analyticsInteraction using aura component var analyticsInteraction = $A.get("e....
2
votes
2answers
2k views

Load third party JS in LWC

I created a static resource with just one JS file. However when component rendered it gives me an error "undefined". Template: <!-- videoPlayer.html --> <template> <div class="...
1
vote
1answer
32 views

Unable to Populate ParentId and RecordtypeId in LWC

I have created a custom record creation page using LWC and overridden the standard new button with the help of Aura component. But I am having an issue in populating the ParentId and Recordtype Id in ...
1
vote
0answers
42 views

Can I bold the last three lines of “lightning-datatable” in a LWC?

//html <div class="last-row-bold"> <lightning-datatable class="slds-table_striped" key-field="Id" data={dataForDisplay} ...
1
vote
0answers
38 views

Modify lightning-tree to work like lightning-tabset

I have an application that utilises mix of nested tabsets and trees - see this playground: https://webcomponents.dev/edit/vXwtMddn7CcREzy4KXK4 I'd like lightning-tree to behave more like lightning-...
1
vote
1answer
43 views

base vs Narrow in lightning-card in LWC

I am new to LWC and trying to understand the concepts. In lightning-card, as per the documentation, the variant can be base(which is default) or Narrow. But from the below code, the output is same for ...
1
vote
0answers
49 views

How to fix 'The requested resource does not exist' error message for 'lightning-record-form' in Community page

I am getting the below error in Community when I am using 'lightning-record-form' in my code. My code is working fine inside Salesforce but in community it is always throwing me below error on Save. ...
1
vote
0answers
45 views

Currency value is converting to integer from LWC to Apex

Passing the below object from LWC to APEX Method, in this Payment_Received__c value is 10.50, when i read this value in Apex method its print 10 [ { "Name": "10618", ...
1
vote
1answer
18 views

Passing recordId parameter from Aura:attribute (originally set by javascript on a VFP)

I am trying to pass a recordId from a visualforce page to an aura:component and finally into a LWC. The LWC is not accepting this, and because it is a managed packaged (open source), I am unable to ...
1
vote
0answers
29 views

Cannot read property 'addEventListener' of undefined (calling assignedNodes())

I'm working with a custom data table that lets me insert a lookup component in each row. So, I import the lookup template from the same folder as the custom datatable:import LookupTemplate from './...
1
vote
1answer
51 views

enable slds-scrollable_x without slds-scrollable-y on Combobox

I am working on a LWC that contain a data table. My data table beiing with a large number of columns, I decided to enable the class slds-scrollable which now contain the table within the div Have a ...
1
vote
1answer
26 views

How to remove padding from community page

I have created below LWC page HTML: <template> <p>Hello From the community page.</p> </template> no CSS and JS added just above 3 lines in the HTML Added it on the ...
1
vote
1answer
50 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....
1
vote
0answers
20 views

Reset styling for sub-component

I have a sub-component inside of an parent component. The styling in the parent is incorrectly being applied to the sub-component, how do I reset it? Specifically, I have a modal popup that get ...
1
vote
0answers
55 views

LWC event target data attributes propagation not working in Lightning Experience?

In a parent LWC component I am using a child LWC component like so <c-comp key={stuff.id} data-name={stuff.name} parameters={stuff.parameters} onresultavailable={handleResultAvailable}/> and ...
1
vote
0answers
80 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
0answers
22 views

Change record id of lightning-record-form

I want to change the ID of the form but it doesn't load the new record. I have something like this: <div class="slds-modal__content slds-var-p-around_medium" id="modal-content-id-1&...
1
vote
1answer
34 views

pass query parameters to urladdressable aura component with child lwc

I have a lwc inside an aura component urlAddressable. The idea is to navigate to that lwc from a record page, and passing the record id and maybe other data via query paramaters in the url, for ...
1
vote
0answers
38 views

Attempting to get an http request with user input from LWC input field

I am trying to allow our Salesforce Users to paste a unique number into an input field on an LWC, then let an Apex Class process a named Credential HTTP request - currently getting an error and not ...
1
vote
0answers
101 views

Looking for Method to view Omniscript JSON in LWC override element

We are using an LWC overwrite on a Text element in an Omniscript. We have a requirement to view the current JSON data in the Omniscript at runtime in order to populate values inside of the LWC being ...
1
vote
1answer
100 views

spring 21 LWC quick actions - how to change modal width?

So if i decided to wrap my lwc component in an aura component i could easily do something like <aura:html tag="style"> .slds-modal__container { min-width: 90rem; } </...
1
vote
0answers
156 views

Lightning Web Component 'lightning-input-rich-text' Change Font Size

I have a lightning-input-rich-text (LWC) in which I'd like to change the default text size from 12 to 10. On following the instructions in https://developer.salesforce.com/docs/component-library/...
1
vote
0answers
78 views

[LWC][CSS]slds-backdrop is not covering full device height behind slds-modal in Salesforce mobile app

We are using slds-modal in our LWC, which is working fine in desktops and large devices. Means behind the modal we are showing the slds-backdrop screen and it covers everything behind the modal box to ...
1
vote
1answer
44 views

Customize the CSS of lightning-helptext

I am trying to customize the borders of the standard help text and using in a LWC component like below: I would like the popup to look like a rectangle instead of the curved border.
1
vote
0answers
114 views

Should “View Report” work in a Digital Experience (AKA Community)?

As described here How to get a standard Salesforce report chart to appear in a Digital Experience (AKA a Community)? I now have report charts showing in my Digital Experience which is great. Clicking ...
1
vote
0answers
78 views

Datatable column-widths-mode=“auto” creates horizontal scrollbar on table

When I set column-widths-mode="auto" on a <lightning-datatable>, I notice there appears a horizontal scrollbar. This seems to be a bug. Anyone know anything about this, or how to fix? (...
1
vote
0answers
143 views

Can we render multiple templates in just a part of an LWC component?

With multiple templates we can replace the entire content of a component with a different html file. Does anybody know if its possible to do this with just a part of the component rather than its ...
1
vote
1answer
51 views

Sending list of objects from LWC works with wrappers but fails with list of maps

I have a LWC that sends the following list to apex 0: Agent_Mobile_number: "999999999999" Call_Date: "2021-05-08" Call_Remarks: "LOL" __proto__: Object 1: ...
1
vote
1answer
70 views

Child component not refreshing when updating data from Parent Component

I am using a util lwc data table and passing list of records from the parent component, I am using a refresh button to re-fetch the records from Apex (imperatively) and update the LWC data table but ...
1
vote
1answer
112 views

I'm trying to display Radio Group horizontally in lwc, but it seems to be not applying my custom css

HTML <template> <lightning-radio-group name="radioGroup" label="Radio Group" options={options} ...
1
vote
0answers
19 views

Can I get the position of dragged element in lwc

I am trying to implement drag and drop in lightning web component with a bit nicer animation, which means I want to be able to see some animation when the dragged item is hovering over some other ...
1
vote
0answers
58 views

How do I make LWC datetime input close drop down when enter key is pressed?

I have a lightning-input (datetime type) and our users will sometimes type 11:59pm in the time field since the drop down selections are only in 15 minute steps. After they are done typing, the ...
1
vote
0answers
46 views

Is there any way to change lightning-helptext icon color in LWC?

here in my component I have 4 lightning helptext: https://developer.salesforce.com/docs/component-library/bundle/lightning-helptext/example And my task is to change their icon colors to blue/yellow/...
1
vote
1answer
184 views

Lazy loading lightning combobox lwc

I have a 'veryBigArrayWithData' that can have thousands of records. When clicking on a lightning-combobox to load label-value pairs from this array, the page becomes unresponsive due to the big ...
1
vote
1answer
50 views

Populating a combobox with Salesforce data

I want to create a component with one input box with type="date" and a combobox that gets populated with options after a date is selected in the first input box component. I want this to ...
1
vote
0answers
50 views

Use data from previous page in Lightning Community with lwc

We have a Community made up of 2 pages, using lwc and also Apex (for org queries and API calls). We go from one to the other with Navigation Mixin. On the first page, we get a lot of data from Apex ...
1
vote
0answers
40 views

Date convert from DD/MM/YYYY to yyyy-mm-dd

This will not convert my date dd/mm/yyyy to yyyyy-mm-dd that I send through the frontend. HTML <div if:true={isMobile} class="slds-size--1-of-1 slds-large-size--1-of-2 padding_10"> ...
1
vote
1answer
73 views

LWC Dual list box setting the value getting Uncaught (in promise) TypeError: this.value.forEach is not a function

Trying to set dual list box value getting below error **Uncaught (in promise) TypeError: this.value.forEach is not a function at ie.get computedSelectedList [as computedSelectedList]** HTML <div ...
1
vote
0answers
45 views

How to deploy code to SF instance from your branch?

Can I deploy my git branch to salesforce org? Currently, I write my code in vscode and deploy it to org using vscode. If it works, I add that code in the git branch and commit, which gets merged later....

1
3 4
5
6 7
33