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

SOQL for Approval History

I'm trying to create this in an LWC and can't put together the right SOQL to grab all the data: SELECT CreatedDate, StepStatus, OriginalActor.Name, Actor.Name, Comments from ProcessInstanceStep where ...
0
votes
0answers
12 views

Only approved users must be allowed to self register in the community [closed]

Has anyone implemented similar to below scenario for the community ? How to proceed with it? When a new user self tries to self register in the community :- An email must be sent to the admin. Once ...
0
votes
1answer
13 views

PDF viewer on iFrame not showing download and print button

I have the below HTML <iframe id="pdfFrame" src="/resource/pdfjs/web/viewer.html" width="100%" height="100%" class="pdfFrame" onload={...
0
votes
1answer
26 views

Learning VF development in 2021..would it help? [closed]

Is learning VF development in 2021 still worth it? With aura and LWC in place especially the LWCs greatly supporting "anybody can code"? Would learning VF development be beneficial in 2021? ...
0
votes
1answer
18 views

How can I automate page load time testing?

I'm trying to get metrics for page load times. I'd like to load the page many times, say 100 times, and get the average time it took to load the page, from a virtual Cmd-R to the page remaining stable ...
0
votes
1answer
44 views

Data not showing after selecting the picklist value in lightning

I have a picklist value account and contact when i select account or contact it will not showing me the data table of account or contact HTML <template> <div class="slds-form-element&...
1
vote
1answer
27 views

What difference does the __c make in currentPageReference in code?

What is the difference between keyword and c__keyword in the code below? What is happening below? this.searchKeyword = this.currentPageReference.state.keyword ? this.currentPageReference.state.*...
0
votes
0answers
15 views

Why is my lightning map disappearing after a split second?

I am trying to use a lightning map in communities to visualize some data and I started by using the example in the documentation to simulate what I need. I want to have two options. Either show a list ...
0
votes
1answer
22 views

With an onchange event handler on a lightning-input-field (checkbox) in LWC can I change the required fields on/off based on the value of the checkbox

Here is my current code which works when the checkbox is changed. But I need it to make the required fields required again if the checkbox is unchecked (changed again). Ideally I guess I would want to ...
0
votes
1answer
31 views

How do I dynamically pass data into a LWC modal?

I have a reusable modal component where I can pass content into a slot. I've added an instance of it on my page, like: <c-modal> <slot>Sample modal content</slot> </c-modal>...
0
votes
0answers
27 views

Custom field are not displayed in the Lwc

I'm trying to pass a list of assets to the lwc from the controller but when reviewing the data, only the values of the standard fields are arriving, the custom fields do not appear This is my ...
0
votes
0answers
42 views

Two parent component invoking the same child component issue

I have an issue that seems to show that I am missing something in LWC I have a big Parent component lets call it A This component A has two child component B and C. Both B and C component are using a ...
0
votes
0answers
13 views

Can we use NPM modules or libraries from CDN in LWC custom component [duplicate]

How can we use npm modules in LWC? I'm trying to use Select2 library in my LWC component. This library is also available in CDN, can we use it in a static resource?
0
votes
1answer
53 views

Displaying PDF using Lightning web component

I have the below HTML: <template> <lightning-button onclick={generateData} label="Generate PDF"></lightning-button> <iframe id="pdfFrame" src="/...
0
votes
1answer
24 views

How to create a popup on lightning map in LWC [closed]

How can I create pop up like the one attached on clicking of a marker on a lightning map in LWC? Thanks!
0
votes
1answer
27 views

In LWC, component field has incoherent value in renderedCallback

I encountered a very odd behaviour which I don't understand. My component has the following code : myFocusOnRender = false; handleResultClick(event) { this.myFocusOnRender = true; ... } ...
0
votes
1answer
44 views

DML in LWC Apex controller class

How does with and without sharing work in regards to Community users and DML in LWC Apex controllers. Testing without sharing on a community user that does not have CRUD access on the object throws an ...
0
votes
1answer
12 views

Trailhead ERROR - We can't find an App Page labeled 'Working with Data'

Here is my code- HTML <template> <lightning-card> <lightning-record-form object-api-name={objectApiName} fields={fields} onsuccess={...
1
vote
1answer
34 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} ...
0
votes
0answers
18 views

Can I view the code of an existing form in my org?

My task is to develop a modified component (LWC) by analogy with the one that exists. Namely, Work Types. Can I view the code of an existing form and the logic of its operation? Or is it not made on ...
-1
votes
1answer
26 views

download attachements in salesforce [closed]

I query on attachment object in apex to get a specific attachment and then I return a response to lwc, my question is how can I download the attachment in the browser?
0
votes
1answer
25 views

LWC: Datatable not getting correct row number on Action

I am not able to retrieve the correct line of the datatable on my LWC. Ive followed several searches but apparently Im still missing something. Here is the HTML: <lightning-datatable ...
1
vote
1answer
30 views

Sorting the List in Javascript [closed]

@api weekdaySelectionData=[]; The below is coming through data table, but I just want to sort the final list: weekdaySelectionData=[{"Day__c":"Tue","Morning__c":true,&...
1
vote
1answer
29 views

multi lookup within input

I am working on lookup component with multiple selection, as per the design we need to show the selected list and search term both on same component. any inputs to achieve this functionality, Thanks ...
1
vote
0answers
18 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 ...
0
votes
0answers
14 views

How to set focus on an input field after rendering in lwc

I am trying to set focus to an input field after it is rendered, the input field is focused initially but after the whole component is loaded the focus goes away. renderedCallback() { console.log(...
0
votes
1answer
24 views

Show Change Record Type in LWC

I would like to know if it is possible to show the change record type window in LWC. I have a lead record type that allow a user to enter info with minimal required fields. And then when this lead is ...
-2
votes
1answer
70 views

How do I pass sObject record from LWC to Apex Controller? [closed]

I need to pass the record to the Apex controller from Lightning Web Component. What would be the best way to pass the sobject record?
1
vote
0answers
48 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 ...
2
votes
1answer
40 views

LWC launch URL from apex class

I'm struggling to find the best way to accomplish this - any suggested are appreciated! I have an LWC for a community page that will have a button to launch an external URL. The URL needs to be ...
0
votes
1answer
40 views

Validation Rule error not showing in lwc near field even though error location specified

I have a validation rule error that fires when Defect__c has a value and DefectReason__c is blank. In the validation rule, I have set the error location to DefectReason__c. The error message shows ...
0
votes
2answers
73 views

LWC : onchange Handler not getting fired when @track attribute is changed

I have two lightning input in a simple LWC component having respective onchange handlers and being @tracked with respective attributes. Second onchange handler is getting fired when I update second @...
0
votes
1answer
31 views

Trying to take make fields mandatory `lightning-input-field`

I'm trying to make fields are mandatory to fill, but its not working with lightning-input-field How to achieve it with lightning-input-field <lightning-record-edit-form object-api-name="...
2
votes
1answer
39 views

How to populate multiselect picklist from list or array of string or a string(; separated) in lightning web component

In my lightning web component, I have a which has a multiselect picklist field from an object. I want to populate that field with values from a list returned from an apex method. I tried to assign ...
1
vote
0answers
32 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/...
0
votes
0answers
15 views

Get a list of record values from lightning form

I need your help for get a dynamic values from a dynamic form. What I mean with "dynamic form"? Well, I have the next one code for create 1 or N records <aura:attribute name="...
0
votes
0answers
19 views

Getting Unable to get property 'value' of undefined or null reference - Lwc Quick Action

I am getting the below error, The component work fine once first called by quick action but once i go back to the same quick action I get the below error. If i refresh the page then i dont get the ...
0
votes
1answer
33 views

Doing CRUD operations in LWC vs doing CRUD operations in Apex?

I have a LWC button that when clicked calls the controller class which calls another class which does a callout and depending on the response modifies the records accordingly. After doing the callout, ...
0
votes
1answer
36 views

Lightning Web Component Accessing Attributes From Wrapper Class Without Explicitly Setting individual Attributes or Using Iteration

I've created a wrapper class and have denoted each attribute with @AuraEnabled public Class RecipientWrapper { @AuraEnabled public String FirstName; @AuraEnabled public String LastName;...
1
vote
1answer
39 views

Trying to show PDF in Lightning web component in iFrame but it does not render the PDF file

I am trying to display a pdf file using Base64data in the Lightning Web component, the PDF Viewer renders but it does not get the PDF file in it. here's my HTML: <template if:true={showModal}> ...
1
vote
1answer
39 views

Access html elements in the lwc's javascript

I am trying to create lwc component for community login. I have a plain html with input text to accept username and password. I need to access values entered in text-boxes , in the javascript to ...
0
votes
3answers
44 views

Infinite loading is not working properly in LWC

I have this component in which I have implemented infinite loading, I am getting the data in the console from the apex and it is concatenated with the current data, but I dont know at the very end it ...
0
votes
1answer
28 views

Hook up a Modal to a button in a row LWC Datatable

How can I hook up a modal dialog when user click the column type button (Add) in a DataTable (see screenshot). The rows are generated dynamically in the datatable component. The modal will have some ...
0
votes
0answers
27 views

Not able to add pardot campaign tracking code in LWC

I am creating website using Lightning web component (LWC) on communities that has a number of pages. I want to track the activities on each page using pardot tracking code. But seems like it is not ...
0
votes
1answer
16 views

error on page while displaying lwc component on record page

i want to create account records using lwc with its 6 fields. code was deployed successfully but when i deployed it on page it gives error-the page has error you might need to refresh it. here is my ...
0
votes
1answer
20 views

Why is my input not displayed as in the documentation?

Here is my code where onclick is added: <div class="slds-form-element"> <label class="slds-form-element__label" for=&...
4
votes
0answers
46 views

How to make a required `lightning-input-field` field not required?

Is it possible to make a <lightning-input-field> where field-name is required (such as Contact.LastName) not required on the UI? I would like the field to not kick in validation rules (client ...
0
votes
2answers
33 views

Lightning LWC - Copy List with Limited fields [closed]

I am using the wire service to query several fields and assign to a list. I am trying to create a PDF using jsPDF and I need to create another list that only contains the fields that I will display ...
0
votes
0answers
10 views

How to set field width fits with its content

I'm very new to start learing Aura component and LWC I have to use lightning:datatable to create a list view in related section. JS file's content: init: function (component, event, helper) { ...
0
votes
1answer
20 views

How can I get pass a value to a js method that was entered in html (LWC)?

While experimenting with LWC I wrote the following code: <lightning-layout-item size="1"> <div> <...

1
2
3 4 5
96