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

Intialize the value of lightning-input with function (event) in lwc

I want to initialize the value of lightning-input with function SearchText ,fill box with a default value(using the function SearchText) . but I don't know how thank you for helping me here is my ...
0 votes
1 answer
728 views

Internal Server Error/Bad Request when Passing an object to an Apex Class

Bear with me if this seems pretty basic, i'm starting out in lwc, so have probably missed something obvious. I have a lwc which i am trying to pass some data into an apex method and have it return ...
1 vote
1 answer
1k views

How do you format LWC´s datatable date picker´s input display date?

I have an editable date column in a lightning datatable. I need to format dates in that column even for the date picker. Is there a way to show the string "28 Oct 2020" in the format dd/mm/...
1 vote
1 answer
31 views

LWC: How to clear lighting-input[type="file"] selected file?

I think this is the same as this question, but "updated" for LWC. I have sample codes here: <template> <lightning-card title="File Select Demo" icon-name="...
1 vote
1 answer
38 views

Can we use styling hooks on lightning-progress-indicator ? Or how to change background color of steps?

I have been trying to modify the standard color for the 'completed' steps on the lightning-progress-indicator LWC (path type): https://developer.salesforce.com/docs/component-library/bundle/lightning-...
0 votes
1 answer
22 views

Mutating API property to contain key to be iterable in for:each

How can I pass an array of strings (errors) into a separate child component (c-component-errors), and be able to show a toast for each one by iterating them using <template for:each... My issue is ...
0 votes
1 answer
1k views

How to set the Value as blank in LWC

Hi if my criteria gets satisfied i need to set the value as blank in input field in the Lightning Web Component. please help me out for this. Html:- {dueDate}
-1 votes
1 answer
29 views

I am getting Format of date time 2023-07-17T07:00:00.000Z in my LWC component, but i want only date

{label:'Start Date',fieldName:'StartDateTime',type:'Date-time'}, datatable in js
1 vote
2 answers
2k views

Error In Deploying LWC

I'm trying to deploy my code but when It's not updated in custom components Kindly advice what's the issue and can you advice also the difference between working on scratch orgs and non-scratch orgs ...
0 votes
0 answers
25 views

Send email with file attachment in aura component

I have an aura component and I want to send email with attachment. The files gets added to the record but it doesn't gets attached to the email. The email is send without any attachment. Component: &...
0 votes
0 answers
20 views

LWC component load on a tab , how to add parameters to the url after fetching data

I have a component that loads on a custom tab, URL is : https://qa3-sprint9--mrredesign.lightning.force.com/lightning/n/Escalation_Studio On Initial load, this component is loaded blank. There is a ...
-2 votes
0 answers
103 views

LWC - How can I Edit and Save record in the following Custom Table

I need to add save fucntionality in this data table, how can I do that, this is my code. Please help...!! HTML <template> <lightning-card title="Contact Details" icon-name="...
0 votes
1 answer
22 views

disabled the button when the Checkbox checked by default in lwc

I want to disabled the button when the Checkbox checked by default here is my code : import { LightningElement } from 'lwc'; export default class Dis extends LightningElement { inputVal =...
1 vote
1 answer
62 views

How To Get All The Favorites In Salesforce?

I am using as reference this documentation: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_favorites.htm And it says that by doing an HTTP GET request to this url &...
0 votes
0 answers
44 views

Manipulating lightning-input-field time field value

I'm trying to figure out what's the best way to manipulate value for time field from javascript. When loading a record with LDS the value of the time field is an integer represented in milliseconds, ...
2 votes
1 answer
1k views

In lightning-datatable, is there a way to get focus?

I have a lightning-datatable, and I'd like to use keyboard shortcuts for my actions -- but to do that I'll need to be able to determine the row that is currently in focus. I can't find documentation ...
1 vote
1 answer
2k views

Unable to deploy source to dev-hub enabled org

as part of doing Push and Deploy Lightning Web Component trail (https://trailhead.salesforce.com/content/learn/modules/lightning-web-components-basics/push-lightning-web-component-files), I have been ...
0 votes
1 answer
36 views

Lightning Base components vs Developing Lightning Web Components

I am looking at the lightning design system component blueprint documentation and reviewing the various ways we can use the Lightning Combobox. For example, in the documentation, they go over Grouped ...
0 votes
0 answers
20 views

navigating from aura to lwc component with background context

I have overriden Opportunity new button with Aura component below. Then I am trying to navigate from aura to LWC with a backgroundContext which means i want to open the lwc just in front of list view ....
0 votes
1 answer
33 views

Account Related Contacts in same Custom table in LWC in accordian manner

I have designed an Account and its Contacts relationship in lightning Collapsible and Accordion style where data should should be in same table columns. The data is not populating correctly since it ...
0 votes
1 answer
24 views

Hide Specific Attributes from Lightning Web Components

Lightning web components come with attributes. For my use case, I do not need all these attributes and I would like to hide them. For example, the Lightning combobox has some of the following ...
0 votes
2 answers
568 views

How to display Contact fields on Account object in LWC

Can anyone explain me how to display contacts fields on Account object Record page. I tried with one of my code, but i add this component in contact page it shows its contact details. but when i place ...
0 votes
1 answer
568 views

How to open a new dialog box in lwc in a pop up window instead opening in a tab or subtab

How to open a new dialog box in lwc in a pop up window instead opening in a tab or subtab. I tried opening using navigation.maxin but it opens in a subtab I have a lwc component and used a lightning ...
0 votes
2 answers
4k views

Create dynamic picklist in lwc

I have custom table with the multiple rows and there are two picklists in each row. Picklist options are as follows: @track picklist1 = [ {value: 'w1', label: 'w1'}, {value: 'w2', label: ...
0 votes
1 answer
656 views

Refresh button with time in lwc?

I have kept the refresh button my requirement is when I click the refresh button it needs to show the time for each time refreshing the page or record there is any resolved solution? Like this, I need ...
0 votes
0 answers
16 views

Unable to deploy Target Config Property with "Role" Attribute when using FlowAttributeChangeEvent to affect component visibility in Flow?

I am looking to create a visual workflow that based on the output of the LWC component, will affect the display of another component on the same screen. I believe I need to set the role attribute of ...
0 votes
1 answer
31 views

design token 'is not defined' error in LWC

Trying to utilise standard design tokens within my LWC so that within a community the LWC will adopt the theme colours. I'm unable to successfully reference a global design token. All I get is a '--...
0 votes
1 answer
56 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(...
0 votes
2 answers
838 views

Unable to access parent component value in child js controller lwc

I am trying to access parent component value in child component connectedcallback but showing as undefined..however, I am able to acess it in html but not in js. Ex: Child comp js: @api res; ...
1 vote
1 answer
52 views

Navigate to Newly Record created record using Flow in LWC

I am creating records using Lead from screen flow after creating i want user to navigate to the newly created Record i am using Navigation Mix in and trying to redirect the record . Below is My LWC ...
0 votes
0 answers
22 views

Managed package Custom App and tabs not visible on production org

I installed a managed package on Production org. After successful installation of the package, the custom app and custom tabs from the package are not visible in the app launcher(6 dots). This only ...
2 votes
1 answer
88 views

Refused to load the script as it violates content security policy while working on LWC file

I am a Salesforce developer. I am a beginner in this. So basically I am working on a particular page. This particular page is dependent on one apex class file and two LWC components. The code written ...
0 votes
1 answer
837 views

How to set maxlength for lightning-input-rich-text

How can we limit the number of characters entered in rich text field lightning field <lightning-input-rich-text value={myVal}> </lightning-input-rich-text> Is there any ...
0 votes
2 answers
50 views

Generate and download PDF file from Base64 Encode String

I want to create a LWC to download a simple PDF file with a random string. Here is my code: Apex class: public with sharing class PdfLwcController { @AuraEnabled public static String ...
0 votes
0 answers
17 views

lightning-button icon not displaying in Flow

I created a lightning component for allowing users to rate knowledge articles with a thumbs up or down. Right now the lightning web component works when it is not in a flow. When it is display within ...
0 votes
0 answers
26 views

How do I retrieve the ID of a related record in LWC?

I have a custom object whose fields I want to display in an LWC under a tab on the Account Record page. I need criteria to query that related record, I only need one record stored and it's rare that ...
0 votes
0 answers
16 views

LWC: CustomEvent not propagating to grandparent [duplicate]

I have 3 LWCs: grandpaCmp->parentCmp->childCmp If an event is fired from child should that not propagate to grandpaCmp? Example code: grandpaCmp.html <template> <div class="wrapper&...
1 vote
1 answer
32 views

Value is set by getter/setter cant be updated after input reset

I have a form that when I use the below snippet in the controller const inputFields = this.template.querySelectorAll('lightning-input-field'); if ( inputFields ) { inputFields.forEach( ...
2 votes
1 answer
957 views

lwc-services is not recognized as an internal or external command

I am trying to run a hellow world app in LWC open source and after "npx create-lwc-app my-app" when I cd in the dir and run "npm run watch" I get the below error. E:\Development\LWC\workspace\dev>...
1 vote
1 answer
48 views

Not able to invoke Apex method from LWC

JavaScript handler handleStatusChange() yields a 500 error: An internal server error has occurred\nError ID: 1567951226-566936 (-1434965262)" Any ideas on what I might be doing wrong? Is it ...
0 votes
1 answer
31 views

LWC: How to stylize icon inside lightning-button

Is there any way to stylize only the icon in a lightning-button? <lightning-button variant="base" label="Base" icon-name="utility:add" icon-position="right"&...
0 votes
0 answers
26 views

Creating custom detail page tab same as normal standard detail page with two sections with different fields using LWC

I have to built custom record detail page ,same as standard like having inline editing with pencil icon and save functionality as standard has using LWC . I tried this HTML <template> <div ...
-1 votes
1 answer
33 views

lwc - How to get a list of all contacts associated with an opportunity?

I am building a Lightning Web Component (lwc) which is placed on an Opportunity record page. I can easily get basic information on the opportunity with a @wire service, such as: @wire(getRecord, { ...
-1 votes
0 answers
14 views

Lightning Web Components - PDF Record data

I'm making a button that when I press it, I download a pdf with the information regarding a Contact. Following the tutorial: https://www.youtube.com/watch?v=RZ5-AArzZaY and using the jsPdf library I ...
0 votes
0 answers
34 views

Design token to access Logo in LWC which is setup under Login and Registration of Experience Cloud

Is there any design token available to access the logo configured in community administration? Workspace -> Administation -> Login & Registration need to access in registration form build ...
3 votes
2 answers
3k views

EventClick from fullCalendar not working

I am trying to include full calendar to my lwc component. I am using 4 version of the calendar. It renders, but eventClick function does not fire. DateClick works as well, but eventClick nope. Firstly,...
0 votes
1 answer
54 views

popover events doesn't trigger eventClick function on FullCalendar

We are unable to handle the eventClick when an event is clicked from pop over list. This is codepen url to for the POC that we did. It is working fine here. https://codepen.io/shubhamsapkal/pen/...
0 votes
2 answers
348 views

Error while using custom events in lwc

I am trying to setup child to parent communication in lwc but i get error No MODULE named markup://c:customEventChild found : [markup://c:customEventParent] CustomChildEvent.html <template> <...
8 votes
2 answers
658 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
1 answer
22 views

How can I dynamically assign the options of a lightning combobox based on the input of a lightning input?

I have a lightning combobox (sizeCode) that I want to display the size codes for a product based on the model number that is input in a separate field. Apex class is working to return an object filled ...

1
2 3 4 5
133