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
1 answer
27 views

LWC not displaying any Data in component when attempting to display the Account on Contact

I'm trying to display an LWC component on my contact that shows the Account Page, but I see no data when the page is loaded. (I'm using standard objects as a proxy here as the end goal is to use this ...
-1 votes
1 answer
25 views

How to embed Qualtrics script in Salesforce LWC?

Is it possible to open the following code snippet using LWC. <!--BEGIN SNIPPET--><script type='text/javascript'> (function(){var g=function(e,h,f,g){ this.get=function(a){for(var a=a+"...
0 votes
1 answer
28 views

How to deserialize JSON array which contains custom fields? Passing data from LWC to APEX

I have an array JSON which contains custom fields as well as some other data as below, jsonString = '[{"Id":"a2l0E000000WFL2QAO","Name":"TCIP-0000022","...
0 votes
1 answer
27 views

how to move focus to lightning input field?

I am trying to move the focus to lightning-input field when clicked on tag. I am getting the value for the data-id set in the tag but focus() function isn't working. Also If I hardcode the value of ...
0 votes
1 answer
26 views

Need string[] or custom object in lightning__RecordPage targetConfig property

I'm new developing LWC but I don't find any information regarding my problem. I need to build a component that can be configured differently in some of the pages, so I would need to have multiple ...
0 votes
1 answer
27 views

Conditional Criteria on Lightning button disabled attribute doesn't work

Can someone help me how to make this work please. Wanted to disable the button based on the following criteria //Diabled criteria - MUST be disbaled for all rows except for last row. //Background - we ...
  • 25
0 votes
0 answers
21 views

How can Install Vlocity DataPack

I need to install Vlocity Data Pack "Explore & Checkout using Digital Commerce LWC" but when i click next button to install it, it gives me "Import Error & Invalid Data" ...
  • 1
0 votes
1 answer
32 views

Not able to see the values of object?

In the below code i have created object "cart" and i have assigned that "cart" object to "addToCart" variable but not able to see the assigned values of "cart" ...
0 votes
1 answer
37 views

How to add css to change the label color of navigation icon in LWC

<lightning-vertical-navigation selected-item={selectedItem} onselect={handleselecteditem} class="navigation"> <lightning-vertical-navigation-section label="...
0 votes
1 answer
65 views

How can you use getSObjectValue() in a child component who's property is declared with @api?

Summary: Is there a way to pass an object from a parent component to a child component so that the child component can use getSObjectValue() to read field values? The naïve implementation fails ...
  • 149
0 votes
0 answers
36 views

lightning-tab not receiving focus when page is loaded

We have a page on experience cloud. We have two tabs and used lightning-tab inside lightning-tabset for this. We have tried to provide the focus by using focus event as follows - this.template....
0 votes
0 answers
19 views

get contentDocumentId from ContentDocumentLink without apex

I am trying to get ContentDocumentId from ContentDocumentLink using wire method. But i am unable to get any results . The purpose of using wire is any file which is beyond 6mb is throwing error ...
0 votes
0 answers
23 views

{Symbol(@@lockerLiveValue) : undefined} when passing list between lightning web components

When passing a list from a parent to child component in LWC, I am getting errors when trying to access the list from within the child component. For example, pass a list containing just an ID ['id1'] ...
-1 votes
1 answer
30 views

Securely call an external API from a LWC

I want to call a non salesforce API from an LWC UI. I want the request from the browser to the API to be secured (authenticated at the very least and ideally authorised). From what I've read, I ...
0 votes
1 answer
46 views

LWC Component Error: Cannot read properties of undefined (reading 'description)

Using a Custom Metadata Type to store relationships between text fields, I'm trying to create an LWC to surface data as dependent picklists. However, when I add the LWC to a record page, I get this ...
0 votes
1 answer
67 views

this.template.querySelector is not returning list of objects in LWC

I have a requirement where I have to make a checkbox checked/unchecked based on the boolean field on Case object. When I am trying to select the element using querySelector, its not returning the list ...
0 votes
1 answer
38 views

Dynamic question display in salesforce [closed]

I have a requirement where i need to achieve the below structure Question 1: Answer 1 Answer 2(selected this so below subquestion should open) Question 2 Answer 1 Answer ...
0 votes
0 answers
22 views

Quick Action that open custom LWC tab?

I have a custom tab of a LWC, I wanna to open this custom tab when the button, that is located in the detail record, is clicked, like a quick action I tried this: <aura:component implements=&...
  • 17
0 votes
2 answers
47 views

LWC- when I click with in the div relevant checkbox should be checked

HTML : <template><div class="slds-grid slds-wrap"> <template if:true={checkboxList}> <template for:each={checkboxList} for:item="m"> ...
0 votes
1 answer
41 views

MetadataService API custom field label update

Recently I am building a side project myself to allow user mass update custom fields label. Currently, you can only do that one at a time. The POC looks good, I am able to achieve that with text and ...
  • 594
0 votes
0 answers
18 views

Can I capture events (and data) from Salesforce UI (iFrame)?

if I am logged in to Salesforce, and I have Salesforce UI embedded in anothre (not Salesforce) web application (REACT). Can I allow my REACT application to capture things like: When a row in a List ...
  • 1
0 votes
1 answer
19 views

How to remove column adjuster in Lightning Data Table?

I have a Lightning Data Table component in my Lightning web component that displays data in several columns. By default, the data table displays a column adjuster in the top right corner of each ...
0 votes
0 answers
54 views

Trying to access LWC Component from vf page for custom change password feature in salesforce

Please find below code snippets <apex:page showHeader="false" sidebar="false"> <p>Test VF PAge</p> <apex:includeLightning /> <div id=&...
-1 votes
0 answers
16 views

external site link (a href link) not working from Experience Site in the Builder in Preview Mode

I have an anchor tag which opens an external site. The only thing is Im in Experience site in the Builder Mode. I am doing a preview. Havent published it yet. The anchor tag doesnt work even when I ...
  • 63
-1 votes
0 answers
23 views

Subscribe to a platform event via LWC from a list button url custom button

The LWC that I have subscribes to a Platform Event. This works well on a screen flow action (pop-up) or when it is just on a flexipage. However the same LWC doesn't seem to subscribe to this event ...
0 votes
1 answer
29 views

Embed Managed Aura component inside LWC

Is there a way to embed an Aura Managed component inside an LWC? The reason is that the aura component shows me which image is currently selected, and I can get the "src" by querying the ...
0 votes
1 answer
41 views

How can I show Vacancy records that are within a certain radius of my Account records?

a Salesforce newbie here. I have a geocoded Account object, and a Vacancy object. When I click on any account record, I need to see all the vacancies that are within a 30mile radius of that particular ...
1 vote
1 answer
42 views

LWC conditional check in for:each on field content

I have an LWC in which I need to check the value of a field in a for:each loop to determine what to display in the HTML. I've tried to find a solution but haven't had success so am hoping someone will ...
  • 1,455
0 votes
1 answer
34 views

Can't get iFrame body or scroll height in LWC

I am attempting to use the code below to get the height of content within an iFrame so I can resize the iFrame height to fit its content. However, when I run it I get Uncaught TypeError: Cannot read ...
0 votes
1 answer
41 views

How to Query ContentNote in Apex and show it in LWC Component

I am running the below SOQL to query to show 5 to 10 Notes records on in a LWC component based on certain conditions SELECT Id, Title, LatestPublishedVersion.VersionNumber, LatestPublishedVersion....
  • 7,705
0 votes
1 answer
27 views

How to remove sorting on a specific column in LWC lightning datatable

I want to remove/hide sort for specific field PARCEL__NEER_LEGACY_NEEPID__c const MERGED_ASSIGNED_PARCEL_COLUMNS = [ { fieldName: 'parcelUrl', type: 'url', typeAttributes: {...
0 votes
1 answer
32 views

Can We Apply Custom Colors to a ShowToastEvent?

I need to drop a simple LWC onto an existing Lightning Record page which just queries for some specific conditions between parent and child data, and if conditions are met, displays a toast message at ...
0 votes
0 answers
22 views

Lightning Tree Grid not rendering data

I am working on a lightning tree grid and for some reason it is not rendering data. Following things i have made sure. All level must have the same attributes key-field must be set. Following is my ...
0 votes
0 answers
27 views

Draw circule icon in lightning map LWC

Hello I have the followed json that shows a location in lightning-map: mapMarkers = [ { location: { City: 'San Francisco', Country: 'USA', PostalCode: '...
  • 1
0 votes
1 answer
24 views

Unable to navigate to salesforce page from Aura application (lightning:navigation)

I've created an aura component to display Contacts list in the form of a data table, When I click on the contact Name I was unable to navigate to salesforce page for that particular contact. <aura:...
0 votes
1 answer
37 views

LWC: Alignment lost when using Name in Lightning-record-edit-form

I have a requirement to mimic the create contact form in LWC. For this, I am using lightning-rec-rd-edit-form. When I use Name field, it consumes 4 rows as it has Salutation, First name, Middle name, ...
  • 329
-2 votes
0 answers
32 views

Lightning map Issue

Hello guys I am working on a LWC that contains a lightning-map. The apex controller brings to the javascript wire method a list of different records that come from different objets. so for this case I ...
  • 1
0 votes
1 answer
54 views

How to make DIV sticky so that its position does not change on scrolling the page in LWC

I am trying to implement a data table which should be scrollable but it should not change the position of TOP and Left blocks. This is my CSS: I am applying this to TOP and LEFT Div blocks. But its ...
0 votes
0 answers
21 views

Issue with platform event connection in LWCs dropping

I've developed an LWC that subscribes to a platform event and several message channels. It works as expected most of the time, except when the connection to Salesforce is dropped (or lost) after no ...
0 votes
0 answers
32 views

how to send data in one component from two different components in LWC using Lightning Message Service? [closed]

Suppose I have a Components A,B and C and i want to send data from Component A and Component B to Component C how can i do that? do i need to create two messageChannels or one messageChannel is enough?...
-2 votes
2 answers
55 views

Show icon map -- Lightning map LWC

Hello guys I am working on a LWC that contains a lightning-map. The apex controller brings to the javascript wire method a list of different records that come from different objets. so for this case I ...
  • 1
0 votes
1 answer
48 views

Unable to add button to lightning:datatable for every record in aura

I was trying to create aura component to display contact details as a lightning:datatable and a button for every row such that on clicking that button it should display contact details like a pop-up, ...
0 votes
1 answer
51 views

try streaming api in lwc

I tried to use the cometd streaming api with the push topic /systemTopic/Logging to get in lwc all notification when a log is created. I saw that only the api v36 can be used for that so I use the ...
0 votes
0 answers
19 views

How to resolve TypeScript module errors for getSObjectValue and schema imports?

I am attempting to enable TypeScript within my Lightning Web Components but running into some issues. In jsconfig.json, I've added the following: "compilerOptions": { "...
  • 149
-1 votes
0 answers
16 views

How to add sorting functionality to ligthning tree grid

I was trying to implement tree grid in lwc and got it done.But the sorting is not supported out of the box mention in specification.I want add sort functionality to the tree gird when clicking on the ...
0 votes
1 answer
32 views

How to conditionally render an LWC component based off of an XML <property> selection?

So I am rather stuck on this issue I am facing, being new to Salesforce. If someone may be able to point me the way to understand the issue a bit better... Issue: I have three image types in my XML ...
0 votes
1 answer
64 views

LWC getRecords - Reactive Variable

I'm having a hard time getting getRecords to work with a reactive variable passed into the recordIds parameter. It works as expected when passing in a hardcoded list of IDs -- per the documentation -- ...
0 votes
0 answers
36 views

Control field editability based on Permission Set and another field's value

I have a requirement that says if Status = closed and the user has a certain permission set, then they should not be able to edit fields that I have on an LWC edit page (lightning-record-edit-form). ...
  • 563
0 votes
1 answer
50 views

In LWC - Showing next component on click of next button before required fields are filled?

I that I have created 3 separate component. The look like this Employee Form : CMP1 Personal Information fname (Required): lname : gender: ...
0 votes
1 answer
42 views

Flow is going back to first screen after clicking FINISH button on screen component

I have a screen flow that checks for a decision and based on the decision it shows the respective screen. When I select an option, it properly navigates to the next screen. However when I click on ...

1
2 3 4 5
157