For questions about Lightning Web Components (LWC) - the UI framework for the Salesforce platform. When using this tag also include the more generic [salesforce] tag.
Questions tagged [lwc]
503 questions
1
vote
0 answers
LWC OSS & Jest - Cannot create elements to test as createElement no longer exists
I'm trying to write a unit test for my open source LWC but cannot complete the test as the createElement member from the LWC package no longer exists. I have been following the docs on lwc.dev but they seem to be outdated and still using…

callthecapital
- 45
- 3
1
vote
1 answer
onsubmit event not working for Lightning Record Edit Form
According to the Lightning Web Component documentation, https://developer.salesforce.com/docs/component-library/bundle/lightning-record-edit-form/documentation, you should be able to create an onsubmit event and prevent the form from being…

TehNrd
- 377
- 5
- 10
1
vote
1 answer
1
vote
1 answer
How to write an APEX @test for a picklist method?
I was searching for answears but I couldn't find it. It might be a beginner question, anyhow I am stuck.
What I am trying to write is a test in Apex. Basically the Apex code gets field names from one specific object. Each fieldname will be shown in…

Klosmi
- 15
- 7
1
vote
1 answer
APEX not allowing queries of 3 levels or more relationships
I am having a dilemma of what kind of query shall I make
Imagine that I'm inside a Details View of an object named Merchandise and of course, with the scope of LWC coding here, the recordID is focused on the Merchandise's.
I want to create a…

Suomynona
- 639
- 1
- 5
- 20
1
vote
1 answer
not working as expected events via HTML can't be called in script
HTML:
Welcome to my first html page...
Another div tag
This is a paragraph
Working on JS
1
vote
0 answers
How to preview a file in a pop up window in the community page LWC Salesforce
I'm stuck to that issues and don't know how to fix that, so As I know standard library such as 'NavigationMixin' for file preview won't correctly work in the community page, so that code won't work
const docId =…

newbie
- 11
- 3
1
vote
1 answer
How to save updated an embedded picklist selection on a custom Lightning Datatable?
I am using a 'Custom Datatable' solution in order to modify picklist values within a datatable. Project code may be referenced here:
https://live.playg.app/play/picklist-in-lightning-datatable
I have made changes so that I can retrieve data from the…

vpsdp
- 11
- 2
1
vote
1 answer
Can I replace the functionality of Platform Event in LWC?
I have a lwc that works with Event Platforms, but event limits are exceeded and I can't reduce them. Is there any functionality or method that can refresh my component in real time without platform events?.

Arturo Castro
- 11
- 1
1
vote
1 answer
UiRecordApi creating two Record at a time
I'm using uiRecordApi to create record with a specific recordType, but it's making two record instead of one.
One with RecordType I'm giving and one with the default RecordType, which is set default in the org.
Here is my code:
import {…

Harshit Tyagi
- 13
- 4
1
vote
0 answers
How to expose lightning-primitive elements for embedding into LWC HTML files of Salesforce Platform
I am customising LWC for a version for my company. I have been successful importing and extending LightningDatatable in a local app generated by create-lwc-app.
ie.
import LightningDatatable from 'lightning/datatable';
import…

G-key
- 75
- 6
1
vote
0 answers
Salesforce LWC - Breadcrumbs
I am trying to create a breadcrumb using lwc component to display it on my community pages. I don't find a way to get the names of the pages dynamically. I need to use the same breadcrumb component in multiple pages, but it should be dynamic.
Here…

Geek
- 127
- 1
- 12
1
vote
2 answers
Dynamically Adjusting Lightning-Input-Rich-Text's textarea
Im trying to increase the height of the textarea box after a user creates several line breaks within the textarea. I'm having issues finding a way to target the value of the textarea height in order to increase it per line break. I would appreciate…

denzgrant
- 11
- 2
- 3
1
vote
1 answer
Remove "or Drop files" section/part from file upload button in Lightning web component
Hi is there any way of removing this "or drop files" part from the lightning file upload button ?
In the below screen shot i want to remove the "or drop file" section and only keep the button and functionality as such...
is this possible ?
tried…

Gon
- 39
- 1
- 8
1
vote
1 answer
Finding or creating the url for a new Lightning Web Component/ Sales Force
I am new to Sales Force and I want a newly created Lightning Web Component to be accessible by url to outside clients. I'm adding to an existing SalesForce instance.
We have several existing lwc in our code base, two of which are accessible by url…

Sorrel Brigman
- 13
- 3