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

Problem while I tried to deploy lwc component to org

Javascript import { LightningElement } from 'lwc'; import { showToastEvent } from 'lightning/plateformShowToastEvent'; export default class MyApp extends LightningElement { handleAlertClick() { ...
0 votes
0 answers
8 views

How to save a selected item from a picklist, a date to the same object, then the selected date and item should not be available, all in in LWC/Apex?

I'm trying to create a Salesfroce lightning reservation app. In that app the selected User can select an item ('desk') from a picklist, then pick a date from a datepicker. When a user clicks on the ...
  • 1
1 vote
0 answers
22 views

LwcWebpackPlugin with AliasModuleRecord for lwc.dev isn't loading HTML file for component

I use LwcWebpackPlugin to load Lightning Web Components. Everything works fine but because I want to load compoennts from 'lwc' direcotry the namescape won't work. I must get components from /lwc ...
0 votes
0 answers
22 views

Files from SF library are not displayed for Partner user in Community Site

I have created LWC where i want to display in img tag file from files library in Community Site (LWR). (JS) getFilesOfPodorysyApp() { getFilesOfPodorysyApp({contentDocumentIdOfFile: this....
  • 1
-1 votes
1 answer
23 views

window.alert("msgg"); not working in vs code shows unexpected alert

import { LightningElement } from 'lwc'; export default class BottonClick extends LightningElement { fun() { var msgg = "message for user"; window.alert(msgg); } ...
0 votes
0 answers
19 views

How to navigate from click of the bell notification to lightning tab

I have a requirement in LWC, onclick of button it should send a notification to a manager user. when manager user logins and clicks on the notification, so it should redirect him on custom tab called '...
0 votes
0 answers
13 views

When i click 'X' button in lightning-file-upload popup after file upload..why the operation not get terminated, still it successes? How to cancel it?

when I upload file in lightning-file-upload, a popup with 'Done' and 'X' button appears but when I click 'X' button still the file gets uploaded. Why this as it should cancel the file upload operation....
0 votes
0 answers
26 views

show toast message with custom field values

I have a requirement to show toast message on account record opening and that toast message should display account related contacts first name separated by commas, How we can create lwc component for ...
-1 votes
1 answer
28 views

How to display lookup field in datatable ? LWC

I want to display Owner.Name as column in Datatable so : Js : @track columns = { OwnerId : {label: 'NOM COMPLET DU PROPRIETAIRE',value : 'OwnerId',fieldName: 'OwnerId',type: 'lookup'...
  • 17
0 votes
0 answers
21 views

LWC: how to go back to default value from <c-publish-cmp>?

If I press the cancel button, I want to reset the value of the combo box made using the tag. I tried two methods, this.template.I tried both querySelectorAll() and value=null; but it didn't work at ...
-1 votes
0 answers
23 views

Cannot read properties of undefined (reading 'Name') in dual-listbox LWC

HTML : <lightning-dual-listbox name="fieldSelection" label="Select Fields (at least 5 and at most 10)" ...
  • 17
-1 votes
1 answer
24 views

How to hide column in Datatable LWC?

I build my columns based on this query : export const caseFieldSelector = "CaseNumber,IncidentSuivi__c,OwnerId,Subject,Status,Owner.name,AccountId,Account.Name,Interaction_client__c,...
-2 votes
1 answer
38 views

How to delete columns from Datatable using LWC?

Onclick Modify Columns I want to display in All selected Field all the columns of datatable and to be able only to delete columns HTML : <lightning-button label="Modify Columns" onclick={...
0 votes
0 answers
28 views

How to pass data from FlexCard to Omniscript?

I have an Omniscript with a FlexCard (custom LWC) inside. How could I get data from this FlexCard to the Omniscript? I didn't find any doc about it.
  • 79
0 votes
1 answer
53 views

LWC - Perform Data validation on Table upon entering value on Table column and populate other columns

In one of my requirements I am having a empty table with just one blank row having some 5 columns. I can enter new record/data on the rows. On one particular column, when the user enters the data on ...
0 votes
0 answers
25 views

Error ssl reason: write EPROTO and wrong version number

When i try to implement the lwc Ebike project i have this error and I can't understand :
1 vote
0 answers
23 views

Invoke ScreenFlow on click of button in LWC component

I have three flows , a main flow and two sub-flows .I need to invoke the Main flow from button in LWC component I was thinking around if we can embed main flow in LWC Component invoked from a button ...
  • 11
3 votes
0 answers
46 views

Do complex data-type parameters for @AuraEnable methods now all need to be global in Winter'23?

We're doing some testing of our managed packaged in a Winter '23 org and noticed that some of the existing functionality is now broken. Looking at the debug logs I can see this type of error appearing ...
  • 31
0 votes
0 answers
30 views

FullCalendar LWC doesn't work on the Lightning Experience site page

I've implemented FullCalendar v.5 (from FullCalendar.io) into my LWC. On the home-, record- or other pages inside the Salesforce platform it works well, but my LWC doesn't work on the Lightning ...
0 votes
1 answer
64 views

Deploy source to org fail!

I am working Lighting Web Component and when I try to deploy my code from the js file the deployment fails with following message: === Deploy Errors PROJECT PATH ERRORS ...
0 votes
2 answers
57 views

Apex Method doesn't return any value

With this code I want to get the value of the myrecord (Volume__c). But with this code I don't get any value. @AuraEnabled public static List <Volume__c> getObj(String recordId){ Volume__c ...
0 votes
2 answers
38 views

LWC Lightning Data Table - Save All Records(Rows) in the Table upon Save Button Click

I have a requirement to be able to save all records present in the Editable Lightning data table and not just the ones that are edited. Is there a way yo achieve this. I see we can only fetch the drat ...
0 votes
2 answers
24 views

LWC dynamically render components and call method for each

I have a parent lwc component and child lwc component.I need for each item in dataList display child component and then call method for each child component. How can I do it via lwc? Its easier via ...
  • 3
0 votes
1 answer
18 views

LWC - Pass event to Aura Component

I am trying to pass an event to my parent aura component however the message within the event is always undefined. Aura: <aura:component implements="force:appHostable,flexipage:...
0 votes
1 answer
27 views

Locker Service SecureWindow returning undefined nodes in Selection API

I'm building an LWC with a dependency on the Selection API. Nodes referenced in Selection or Ranges (i.e. window.getSelection()) behave as expected except where a node in the range or selection is a ...
0 votes
0 answers
19 views

Unable to locate modules/c folder while debugging LWC in browser

So I've been working on several LWCs for SF community and suddenly the modules/c folder in browser's DevTools (both Firefox & Chrome) which contained all the custom components present on page ...
0 votes
2 answers
27 views

Create a Lightning web component for creating records for master detail type

I have two custom objects Building and flat, in this building is the master of the flat object and I have to Create an LWC component for creating new flats. in flats object since building is the ...
0 votes
1 answer
27 views

LWC Code not displaying data

I am new to LWC. I am trying to print data fetched using Apex in LWC but it is neither printing data nor throwing error: <template> <lightning-card title="Call Apex" icon-name=&...
  • 185
0 votes
0 answers
25 views

My date input field doesn't display icon and placeholder on mobile

I'm using a date field in my lwc to use in the community. But it behaves differently between Desktop and Mobile. The placeholder and icon are gone. Desktop version: In mobile: How can I keep the ...
0 votes
0 answers
18 views

recordUpdated for force:recordData not being called for aura component rendering in utility bar

I am rendering an aura component in the utility bar in my lightening app. In my aura component i am using force:recordData, like this - <aura:attribute name="recordId" type="Id"...
2 votes
1 answer
59 views

Creating Multiple Data Table for list of Records using LWC

Can anyone tell me how do I create multiple data table using single lightning data table in my html and iterating over with template for each with the list ? I am looking at something like this: ...
  • 45
0 votes
1 answer
32 views

How to preserve formatting in long text fields in LWC components

I have an issue where while vewing a long text fields data in a standard layout the spacing between para's are preserved. Looks neat. However, when I am trying to read and display the same data in an ...
0 votes
1 answer
24 views

Lightning Web Component Action not showing up on community page

I've been having this issue where I created a LWC to act as an action, and while it shows up fine on the record page, I'm having some issues having it show up on my Community App. At first I thought ...
0 votes
1 answer
26 views

Array is being changed to String inside a arrow function

I am defining my variable as array and pushing values inside it. When I try to access this variable inside another method and apply push function on it, It says, Push is not defined. When I check the ...
0 votes
0 answers
24 views

How to call a method in LWC in a record detail page AFTER committing a DML operation of the record to database

I have a wired method (getRecord via uiRecordApi) in an LWC in the Opportunity record page. It gets automatically called AFTER the record is updated. But the data I fetch from this function from apex ...
  • 738
-1 votes
1 answer
23 views

How to get count of opportunities related with an account in SOQL query?

I want the count of opportunities that an account is related with. I tried the following SOQL query Select Name,(Select Count(Id) from Opportunities) from account but it is given following error only ...
0 votes
1 answer
35 views

Filter and Slice in LWC Array

I am populating an array with a Key and value while checking a checkbox and trying to remove the key/value while unchecking the checkbox in LWC It works if I check/uncheck one of the checkbox. In case ...
  • 5
0 votes
1 answer
20 views

How to track change on an Account field in LWC?

Whenever I change a specific field (for example Account Name), I want to set a template if:true to false, in order to hide an element. I'm using @wire to get the account name from the record page, as ...
  • 3
0 votes
1 answer
25 views

Selected Date Field wont stay on page after clicking out of field

I've just created my first visualforce page and having an issue with the opportunity close date. When I select the close date on the page, I am able to enter this via typing it out or the date picker. ...
  • 41
0 votes
2 answers
65 views

Basic LWC SLDS but columns horizontally uneven

SLDS newbie here. Here's my html: <template> <div class="slds-grid slds-wrap" > <div class="slds-col slds-card slds-size_1-of-4"> <p>...
-3 votes
0 answers
24 views

Multi-level menu items in LWC salesforce [closed]

I have to display a multilevel dropdown in LWC. Can any one please suggest how I can do that?
0 votes
0 answers
30 views

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Name')

How to Solve This Error I am not reading Name here, I am just using the imperative method to display the data in an HTML table, with Pagination. getRecordsMethod(){ const SelectValue = this.template....
0 votes
1 answer
28 views

How to get mouse position?

This is my demo (studio.webcomponents) When I hover over the first row, the div should line up with the mouse position. Note: Need to consider scrollbars HTML: <template> <table class=&...
  • 369
0 votes
1 answer
32 views

Passing a MAP from LWC to Apex

I am trying to pass a map from LWC to my apex. .js handleFieldSelected(event){ this.apiName= event.detail.realApiName; this.fieldValue = event.detail.fieldValue; this....
  • 5
0 votes
2 answers
24 views

LWC select element with multiple

I'am trying to retrieve all the selected values from a select element with multiple options but I can only grab the last selected value. HTML <select class="slds-select" id="select-...
  • 5
2 votes
1 answer
63 views

How to reduce array and add related integers together

i have this array const input = [ { StockKeepingUnit: 'SKU-001', Quantity: 3 }, { StockKeepingUnit: 'SU-002', Quantity: 5 }, { StockKeepingUnit: 'SU-002', Quantity: 7 }, { StockKeepingUnit: '...
  • 25
2 votes
1 answer
49 views

Unable to get Map as return value from Apex in LWC using Imperative Call

Im making an imperative call from My JS to Apex as follows import { LightningElement,track,api } from 'lwc'; import genericOptionsFetcher from '@salesforce/apex/MultiPicklistCls.genericOptionsFetcher';...
  • 35
0 votes
1 answer
19 views

How to tell if refreshApex has new data?

I am using refreshApex to get the latest data with a button. There is a possibility that there are no new changes and I want to display a message indicating there are no new changes. Question How can ...
-1 votes
0 answers
29 views

Mass Update rows with Lookup value LWC Datatable

It is possible to mass update selected rows with lookup value in LWC datatable? I have this possibility to any number or text field, but I can't see this option under lookup field. I want to update ...
0 votes
2 answers
41 views

LWC: How to make DIV fit with mobile view

I have two DIVs which I want to fit in Mobile view according to resizing. In the image, you can its behaving like 2nd image and i want it to behave like 3rd image. I am least aware of responsive pages ...

1
2 3 4 5
142