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
1
vote
1answer
688 views

Lightning web component unit testing. Issue with testing row action event

Firstly, I wanted to indicate that I have poured over the LWC Recipes repo to find this, and I can't. I am trying to get test coverage on a Lightning Web Component. The component has two Sub ...
-2
votes
0answers
16 views

System.LimitException Too Many DML Statements 1 [duplicate]

I have created a lwc form which sends JSON data to Apex class : - let fields_ = {}; fields_[Address__c.fieldApiName] = address; fields_[FirstName__c.fieldApiName] = fname; fields_[...
1
vote
2answers
43 views

New LWC Actions in Salesforce

Looks like in the current release Salesforce has made LWC Quick action "Generally available" but the tag that we use in LWC quick actions which is lightning-quick-action-panel is still in ...
1
vote
1answer
743 views

Lighting datatable Custom Inline Edit

I have a custom LWC Page which is used as Public site. In my Page I have form which will populate the data in Contact object and display the value in Data table. I have integrated inline edit in my ...
0
votes
1answer
33 views

LWC 1001 and LWC 1002 Error

getting these 2 errors while deploying boatSearchResult component of lwc superbadge. LWC1002: Error in module resolution: Error when using sourcemap for reporting an error: Can't resolve original ...
0
votes
1answer
25 views

Wire Service Question

I have a wire service that brings back a listing of records. I also have a "New" button on the LWC which uses a child component with a record-edit-form. I send an event that bubbles up to ...
0
votes
2answers
46 views

LWC use querySelectorAll to get all ids associated with checked checkboxes in the view, and update the Database

My goal is onclick of any checkbox here, get the data-id of all checked activities. I've tried several things, but new to LWC and fairly new to selectors. Currently, when I click any checkbox, the ...
0
votes
1answer
654 views

How to catch server error in JS for LWC

How can I catch the server error message in JS for LWC. I have a trigger for object A and for this object I have LWC where I adding new records. Trigger checking whether percents on object is equal ...
2
votes
2answers
2k views

Importing ES6 module in LWC project (sfdx)

Trying to do something relatively simple. I've 2 LWC component under the lwc folder: lwc/cmp1 and lwc/cmp2 How can I create a new ES6 module that will serve as a utils.js file and then import it to ...
3
votes
0answers
41 views

Allow child to overflow into parent

I have a datatable that's embedded in another component which is resting on a lightning page. What i'm trying to figure out is how to get the picklist to overflow into the parent component / lightning ...
0
votes
1answer
35 views

No apex action available for class.method error

I am getting a very weird error. My LWC Component is referencing two methods from an Apex class. Everything was working fine. Suddenly after a week, I am getting this error: /{"message":&...
-2
votes
0answers
45 views

On button click, Open an LWC component in subtab in service Console [closed]

I have an LWC component, while click on button it should open another LWC in subTab in Service Console. Below is my code to navigate to another LWC, while clicking on button from LWC. As per the below ...
0
votes
0answers
47 views

Why are the column names of my table not displayed?

//html <lightning-datatable key-field="Id" data={dataForDisplay} hide-checkbox-column columns={columns}> </lightning-...
2
votes
0answers
23 views

Why is saveOptions member of UI API Record Layout response always empty?

I am retrieving Layout information via UI API. I have tried this both with the lightning UiApi adapter: import { getRecordUi } from 'lightning/uiRecordApi'; @wire(getRecordUi, {recordIds: "$...
0
votes
1answer
16 views

LWC Lightning Datatable - Number column not getting sorted

I have created a lightning datatable in which I have column with number datatype. However when I click on it, it is getting sorted based on text and not on number. Here is how it shows in Console ...
0
votes
0answers
30 views

LWC Imperative APEX with Parameters not taking Ids

I'm creating a LWC QuickAction. From a lookup field for accounts I need to fetch the external Id of the Account. I get the account ID from the lookup, but when I pass them to APEX, I get Error 500, ...
0
votes
1answer
906 views

How can I validate date in LWC datapicker - lightning-input-field component

How can I validate and set max date - which can't be a future date in new LWC syntax <lightning-input-field variant="label-hidden" field-name="Date_of_Birth"></lightning-input-field> I ...
0
votes
1answer
631 views

dynamically Change the vertical tab LWC

How to change vertical tab dynamically in LWC Html <div class="slds-vertical-tabs"> <ul class="slds-vertical-tabs__nav" role="tablist" aria-orientation="vertical"> <li ...
0
votes
0answers
34 views

Lighting-Input-Field - onchange

I have a lighting input field where onchange={handleChangeInc} The handler is below. This works fine but it also triggers when I save a record using submit. Is there any way to avoid the same ...
1
vote
1answer
40 views

Why is my recordId undefined ? LWC

Problem : I have my LWC inside an Order page, but can't retrieve the recordid which is undefined. Here's a screenshot of my LWC: the header is the standard part with data stored in SF below the ...
0
votes
1answer
18 views

How do I turn this array into one array in LWC?

ExampleArray = [["Relationship", "Subscriber"], ["memberId", "12345"], ["MemberName", "Test Member"]] How would I turn the above into just ...
0
votes
0answers
11 views

Has anybody implemented FullCalendar.io with the Moment since if the user logged into another timezone the timezone should be as per the user log in [closed]

How can we use the below plugin in salesforce I have kept them in the static resource but one of the file is throwing an error https://fullcalendar.io/docs/moment-timezone-plugin
2
votes
1answer
834 views

How to query for lightning-combox items in a lwc-jest test?

I can reference a collection of p tags in lwc-jest, but am not able to do so for a lightning-combobox's items. This gives me values: const cats = element.shadowRoot.querySelectorAll('p'); expect(...
0
votes
0answers
9 views

Unable to open Visualforce page from LWC on Salesforce1, it redirects to web page and asks for password. Works well in IOS issue in Android

I am trying to open a Visualforce Page in Mobile device on a button click from LWC. I am using function navigateToVFPage() { this[NavigationMixin.GenerateUrl]({ type: '...
0
votes
1answer
1k views

Getting Error While Iterating on JSON Array using for:each in LWC

We have data as below in track variable rowColorRules : [{ "color": "#ED0E0E", "criterias": [{ "field": "sdd", "operator": "==", "value": "asdads" },{ "...
0
votes
0answers
28 views

Suscribe to LMS published from an LWC in other package namespace

In a Managed Package, am publishing a message using a Lightning Message Channel in a Lightning Web Component. I want to be able to suscribe to this Lightning Message Channel from a Lightning Web ...
0
votes
0answers
51 views

How to catch horizontal scroll event of a LWC lightning data table to implement fixed column in datatable

EDIT : Background of original requirement. We want to implement a "freezed" 1st column in a custom lightning datatable. When we scroll to the right, 1st column should always be in view. ...
0
votes
1answer
23 views

Why does lightning-input-rich-text add a paragraph tag automatically to the text?

I am using a LWC lightning-input-rich-text that is populated from a custom field value when my LWC loads. This component is used to Send an email where body of email will be the text( value ) in this ...
5
votes
6answers
1k views

recordId is undefined in LWC quick action component

I have created an LWC component for quick action and also defined the @api recordId inside that. But the recordId is undefined in the component when logged. Seems like it is not being passed to the ...
1
vote
2answers
308 views

is recordId passed to lwc in a quick action?

I made a lwc to use as a quick action, but despite declaring an @api recordId property, when logging it in connectedCallback, I get undefined. This is the configuration: <targets> <target&...
2
votes
2answers
2k views

DisconnectedCallback in LWC

I want to do some DML operation when my lwc is removed from the DOM, so can anyone please confirm if disconnected callback will run on all below scenario on close tab. on browser close. got ...
0
votes
2answers
2k views

Submitting a record to create using lwc record edit form

I have an object Foo__c that has MD relationship to Zoo__c object. I am trying to create Foo__c record using lightning-record-edit-form. This is for learning purpose. Below is my code: HTML: <...
1
vote
1answer
39 views

convert event aura:handler from Aura to LWC

I'm trying to convert below part of code from Aura to LWC: Aura Code <aura:handler name="myEvent" event="c:PPFields" action="{!c.handleEvent}" /> handleEvent(cmp, ...
0
votes
0answers
33 views

Is it possible to debug disconnectedCallback? [duplicate]

What I'm trying to achieve: I have several problems with function that is invoked in disconnectedCallback, to debug it i put some console logs in this function, however I noticed that the invoked ...
0
votes
1answer
31 views

'field is undefined' property of object undefined in LWC but testing in JS ide it works

Here's the LWC JS // console.log--> this.tableData = [{"Id":"a4X6t00000006cGEAQ","Sign__c":"No Sign","Notes__c":""}]; ...
2
votes
1answer
583 views

LWC - How do we get Draft value of Custom Lookup in the Data Table?

I'm currently trying to do a mass update of records through the Data Table that includes inline editing. As I understand it's not currently supported natively for Lookups in the Data Table. I ...
0
votes
1answer
20 views

How to upload VersionData as pptx to S3? [closed]

I'm trying to upload a file as pptx. First I'm querying my file from ContentVersion and fetch my VersionData. The VersionData is a BLOB object. When I'm uploading this blob, and then downloads it, it ...
2
votes
0answers
37 views

How to combine lightning-quick-action-panel and slds-modal_large?

I want to pop-up a modal LWC using a quick action, without any Aura components. This should be possible since Summer'21. I am currently using an Aura component that does the pop-up and at the same ...
3
votes
2answers
2k views

Confused about how to make a Lightning modal window pop-up with a quick action

I am new to LWC development, but I do know my Apex code and VF pages. What I am looking for: clicking a quick action on a standard Lightning record page should open a modal Lightning window (which I ...
0
votes
1answer
30 views

Map of Key with List Object print empty Object in LWC

Trying to Create the Map in JavaScript for key as program and List of Object. Below is the Json Object JSONPObject.program = [ { "Id": "a0l5e000002mFg8AAE", ...
0
votes
3answers
2k views

Invoking LWC component from a plain URL - Read URL Parameter inside LWC

Can I invoke LWC component from a URL? or should I wrap the LWC Component in an aura component and then invoke the aura component? If I can invoke the LWC component directly from URL, how can I read ...
0
votes
0answers
24 views

Styling for lightning-formatted-rich-text - Display inline

Is there a way that I can get these items to display in the same line? The lightning rich text value by default throws itself into a new line : Code Subset : <div class="aob_required-actions-...
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 ...
0
votes
1answer
750 views

How to prevent <lightning-input-field> from changing the column width of Custom Datatable in LWC

I have developed an LWC which uses custom datatable. In that datatable, If I use <lightning-record-edit-form> and <lightning-input-field>, the column widths change. Please see the ...
0
votes
0answers
15 views

Experience Builder: Custom Self Register Component

When a guest user tries to register for the community with an existing email address, he gets following error. Your request cannot be processed at this time. The site administrator has been alerted. ...
0
votes
1answer
502 views

LWC is not working with non-admin profiles

I have created a web component to pre-populate child record fields from parent record, its working fine when i tested as a admin, but its not working when I logged in as other profiles, I'm not using ...
0
votes
1answer
19 views

Sending an event when window.location.href changes

My setup: I have a LWC which is placed in Shared Footer, so I don't have to add it manually on every page. This component is responsible only for sending events. What problems do I have: I need to do ...
1
vote
3answers
510 views

How can I load jQuery in LWC?

For the convenience of the user, I'm implementing the requirement of katakana is automatically entered when entering hiragana or kanji in Japanese using this JavaScript library. You can check the ...
0
votes
0answers
20 views

How to display data from objects shown in ERD without affecting performance?

Current State: We created a reportType with "Contact, Interaction & Interaction Contact" objects and displaying the report on Account object using this process: Displaying Summary and ...
1
vote
1answer
2k views

How is the <template> tag used in lwc different from one used in web components?

According to usage of <template> in web components: The elements under template won't appear in your page until you grab a reference to it with JavaScript and then append it to the DOM For ...

1
2 3 4 5
103