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
2answers
19 views

how to change a button variant which is in for loop in LWC

HTML: <template for:each={acc.data} for:item="acc"> <lightning-button key={acc.Id} class="slds-theme_brand" value={acc.Id} variant={buttonVariant} ...
5
votes
1answer
3k views

Setting a max height for datatable in LWC?

I know when you specify a div with a height around your datatable you get a nice scrollable table: <div style="height: 300px:"> <lightning-datatable various-params></lightning-...
2
votes
1answer
1k 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
1answer
2k views

Dynamically adding/deleting rows functionality in LWC

When I delete a row somewhere from the middle, that particular row is getting popped out of my primary array(this.data) as desired but the results are not appropriate on the UI side. On the UI it ...
0
votes
1answer
13 views

How to share lwc modules as reusable utility components

So I am looking to implement reusability pattern across Lwc's using utility components. What Im not understanding is limitations of importing modules/dependencies like ShowToastEvent. If I create a ...
0
votes
0answers
9 views

LWS Button does not close its modal window

The current code, has a Cancel button at bottom of modal. On Click, the modal disappears. Current HTML <lightning-button class="slds-m-top_small slds-m-right_xx-small" type="submit&...
0
votes
1answer
36 views

Trying to render a field when if:false is valid, not working how I expect

I am trying to render not here when activity.name is not present. This would happen if a student doesn't have extraActivites in their JSON payload. In the picture below and in my provided code you can ...
0
votes
0answers
11 views

How to open custom lightning record edit form in a new window

I have a lwc custom record edit form and I would like the form to open in a new window when a button is click. JS import { LightningElement, wire, track, api } from 'lwc'; import getPolicies from '@...
0
votes
1answer
16 views

Displaying Euro currency in lightning-datatable properly

Salesforce junior here. I am currently trying to display some price information in a lightning-datatable. However, the result is formatted like it's seen in the US, while I want it the amount of money ...
0
votes
1answer
25 views

LWC - Refresh contents inside a single <lightning-tab>

I have a component (container) with a lightning-tabset with a single lightning-tab. Inside the tab is a component (dataComponent) which pulls "Item" records via Apex and assigns them to a ...
0
votes
2answers
14 views

LWC event data propagation from child to parent NaN

I am trying to pass some data from a child component to a parent component by following these docs: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc....
0
votes
1answer
11 views

LWC, show/hide on button click

I have the following template (it's larger, here's only a part of it): <lightning-record-view-form> <div id="prefCenter_Interest" class="prefCenter_Block"> <h4&...
-1
votes
1answer
33 views

How to retrieve the array of object?

My Response: 0:{value:0, number:1}, 1:{value:0, number:1}, 2:{value:0, number:1} Expected Output : 0:{number:1}, 1:{number:1}, 2:{number:1} if(result){ const value = JSON.parse(result) for(i=...
0
votes
0answers
25 views

When I change the stages of an opportunity automatically the substages should change without refreshing

I have added substages for each stage of an opportunity and now it should change when each stage is changed.Performed using lwc: My current code js: import { LightningElement,api,wire,track } from '...
0
votes
0answers
65 views

How to retrieve records using the getListInfoByName lightning/uiListsApi?

The API getListUi, which returns column info and records, is now deprecated to be replaced with the getListInfoByName API. However, this API does not return records. Does anyone know of a way to ...
1
vote
2answers
41 views

Problem with generate pdf and content version

i need Generate PDF using LWC from Quick Action. pdfTemplate.page <apex:page renderAs="pdf" standardController="Account"> <h1>Account Details</h1> Dear {!...
0
votes
1answer
21 views

What could I put in Key tags in my .html (LWC)?

In this table I'm using row as key for many html elements. Could this make a difference in the future? Do I need to use a different key for each tag? I thought to use row.postalcode in the first line ...
0
votes
0answers
19 views

Error: value too long for field: source maximum length is:131072 [duplicate]

Error: value too long for field: source maximum length is:131072 Getting above error while deploying Lwc through VScode. Little help would be great. Thanks
0
votes
0answers
20 views

Restriction rules - which HTML markup tag is used?

I am currently testing the new Restriction Rules feature. I have a custom object called Construction and as I am creating the new Restriction Rule and adding a record criteria field, it happens that a ...
0
votes
1answer
32 views

Reinitialize Lightning Web Component after NavigationMixIn

I have an LWC template that has a parent and child template relationship. On the child template I am using the NavigationMixin.Navigate API to edit the record. When a user selects "Save", I ...
0
votes
3answers
1k views

Calling a standard quick action via LWC

The Title says it all , so apparently I have a custom LWC component in a record page , is it possible to have a button there that opens up the standard new dialog functionality? I am thinking of ...
0
votes
1answer
20 views

display array list using lightning-datatable in html LWC

I tried to display my array using lightning-datatable with the below code. However, I can see the table and overview of datatable but no data is displayed in the table. Please help me to identify my ...
0
votes
1answer
19 views

Combining String Plus Variable Within Attribute In LWC Component

Is it possible to combine a string plus a variable in an attribute in a component? I'd like to concatenate "website.com?" with recordId to render https://website.com? 0018c0000289v0pAAA So ...
3
votes
2answers
1k views

LWC -ightning/uiObjectInfoAPI - getting INSUFFICIENT_ACCESS error for custom object

I am trying to get metadata info for a custom object using lightning/uiObjectInfoAPI’ here is what I am doing: wire(getObjectInfo, { objectApiName: BATCH_OBJECT }) getBatchObjectInfo({data,error}...
0
votes
0answers
27 views

How do I send data from a Proxy to a function in LWC?

I'm trying to send a data of a response in a function like function(response) in my LWC, but the response is a Proxy container with format like Proxy {}[[Handler]]: En[[Target]]: Array(0)[[IsRevoked]]:...
1
vote
1answer
63 views

LWS - Apparent difference in behavior using data returned from Apex call

Prior to enabling LWS in Spring '22 we were able to successfully 'modify' objects returned from an Apex Call. After enabling LWS we cannot modify the data. Allow me to give an example. Below is some '...
0
votes
0answers
20 views

LWC changes updates Aura, BUT Aura changes does not updates LWC

I have a scenario where two components an Aura and a LWC were included via Object Record Type. They are placed according to the image below. I'm facing a problem. All the interactions done in LWC ...
2
votes
1answer
2k views

Sending data to lightning-datatable lwc custom column type

I have a custom datatable with a custom column type containing a button, and a modal that pops up after the button is clicked. I am having trouble figuring out how to send my datatable data to the ...
0
votes
0answers
23 views

How to destroy Parent Aura and Child LWC during record navigation?

I have overridden Standard New button on lead object with Aura Component and this Aura calls LWC which contains record edit form to create new lead record but here I am making a server call to create ...
0
votes
1answer
43 views

Conditional Validation not working

I have a component for validation and a required flag. When the input field is not mandatory, The combo-box should throw me no error when i leave it as empty but i still want another validation on the ...
7
votes
2answers
497 views

Event propagation with bubble true in LWC

I'm trying learn event propagation in LWC. As per the documentation it says {bubble: true, composed: false} means the event does not cross the shadow boundary, but it bubbles up the shadow boundary. I ...
0
votes
0answers
16 views

Getting parent record id as undefined in SF1

There is a custom obj, and i am trying to create a record from it's related list and it has aura component embedded with LWC. Now, I need to get the parent record id while creating a record from ...
0
votes
0answers
14 views

Getting 404 not found error while importing the fullcalender library in LWC . Note : i am using the library from (https://fullcalendar.io/)

import { LightningElement ,track} from 'lwc'; import { loadScript, loadStyle } from 'lightning/platformResourceLoader'; import myCalender from "@salesforce/resourceUrl/myCalender"; import ...
1
vote
1answer
36 views

Frontend: get parent element of LWC component checkbox

I am quite new to SF development and as a frontend developer I am experiencing some striggles while taking over a project from a colleague who has just left his job. So please appologize any "...
3
votes
1answer
167 views

LWC Visual Studio Code Dev Hub command

I want to complete the Lightning Web Components Trail on Trailhead but I keep getting the error above. I installed the CLI and updated it to the pre-release version I installed Visual Studio Code I ...
0
votes
1answer
20 views

Unable to extract recordId from the lightning web component

I tried to get record id from the custom object "Categories__c" unfortunately it is not working. When I try the same with the custom recordId, it works. Can anyone help me to solve this ...
0
votes
1answer
19 views

Error during LWC component connect phase: [Maximum call stack size exceeded]

I am trying to assign value to a property of my parent component's constructor method. Below is the html code: <template> {welcomes} <c-testfile></c-testfile> </template&...
0
votes
2answers
30 views

How can I change the output display in lightning app of sales force other than table?

I have created lwc for my custom object and I used lightning datatable for viewing it. Unfortunately I have lot of fields and hence, I would like to change the type of view. I tried using lightning ...
0
votes
2answers
6k views

Empty check in LWC html

How to do empty check like we used to do in Aura bundle <aura:if isTrue="{!not(empty(v.opportunityList))}"> I have a datatable in the lwc and want do display a message when no data to display ...
2
votes
1answer
60 views

How to get code coverage report for LWC unit tests with JEST?

I was working on the unit test setup for Lightning Web Components with Jest and tried to figure out how to get a code coverage report but found nothing in the Docs. By running: sfdx-lwc-jest --...
0
votes
0answers
28 views

Showing Account Details of Related Oppertunity and Contact in a singel LWC datatable

I want to display Contact Name and Opportunity Name and their related Account Details in a Single Table like this Name || Account Details ===============================================...
0
votes
1answer
48 views

Why is getAddressDetails() sending the return last?

I'm calling a Vlocity Integration Procedures by lwc when the user click in a simple button. I need to receive the addressRespose before any result to call other functions, but getAddressDetails() is ...
1
vote
1answer
21 views

Issue with lightning dataTable while fetching related record's field

I am getting the below error Cannot read properties of undefined (reading 'Name') The code for the LWC Component and controller is shown below. ContactController.cls public with sharing class ...
0
votes
0answers
25 views

Accordion-section

I am new to salesforce. I have a table with all the opportunities. How do I create an accordion where the name of the section is taken from the account and amount & opportunity of this account is ...
6
votes
1answer
482 views

Inconsistencies between shadow DOM and synthetic DOM on LWC OSS

We've been working on porting our LWC components from platform into LWC OSS. In order to do this, we have a copy of SLDS classes we have created and we need them to be applied globally. For us it will ...
0
votes
1answer
880 views

Label in LWC Accordion

I'm attempting to customize a label in lightning-accordion. Next to the label I'm trying to place a count that populates from wrapper. <lightning-accordionSection key={account.id} name={account....
-1
votes
1answer
21 views

Update a JSON array on change

I am trying to update a JSON array on change of a value. I am able to find the position where we need to change but when I try to change the element value it shows a sorry interruption popup box. Does ...
-2
votes
0answers
34 views

Download LWC as pdf [duplicate]

I would like to download the content of currently viewing lwc as a pdf. I have seen great answers to download a vf page as pdf from lwc etc but this is needed as per client requirement. Requirement is ...
0
votes
1answer
656 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
0answers
20 views

How to fix the height of my Lightning card at the limit of the screen

I'm trying to fix the layout of my lightning-card, in the full screen of any screen like the card of salesforce page records. This is what i want to do equals: And this is my screen with the card: ...

1
2 3 4 5
117