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

Send email using guest user

I have created an LWC with a form to create a Lead and placed it on the community site which is public. Now when a Lead is created there's a trigger that is supposed to run and send an email to the ...
0
votes
0answers
22 views

how to fetch boolean flag value from parent in child component

I have defined a flag in my child component and sent it as an attribute to parent. I need some of the input fields coming from parent to have some validation and according to the flag value (if true, ...
-3
votes
0answers
22 views

LWC File Related Issue [closed]

I want to display contact ,Opportunity file related to account using lwc please anyone help me
0
votes
1answer
38 views

How should i use setTimeout in this js code in lightning component so that popup opens after 2 min? [duplicate]

const isCookie = getCookie('pre-trial-survey'); if(!isCookie && IS_GUEST) { setCookie('pre-trial-survey', false, 30); this.showPopup=true; window.setTimeout(function() { }, 120000);//...
0
votes
0answers
24 views

NoErrorObjectAvailable Script error in my LWC

I read all question about this error and I cannot find the problem in my code. Here it is: HTML: <!-- ComboBox Main Guilds--> <lightning-vertical-navigation> ...
2
votes
1answer
57 views

How to get code coverage report for LWC unit tests with JEST?

I was working on the unit test setup for Lightning Web Components with Jest and tried to figure out how to get a code coverage report but found nothing in the Docs. By running: sfdx-lwc-jest --...
0
votes
1answer
41 views

How to highlight a searched keyword through LWC

There is a report page in the community page. there is a search button. upon entering the keyword in the input search box and clicking on search it will search the datatable with the keyword. it will ...
0
votes
1answer
17 views

Where to find navigation bar metadata in experienceBundle

I created a community using the Partner Central Template, added a few tabs besides home in the navigation Bar clicking on which opens up the salesforce object pages. Now I can see those object pages ...
0
votes
1answer
51 views

Passing Array of object to apex class LWC

I have array of object which contains two different objects data e.g Secction__c and Question__c @track addSectionRecord = [ { id: '', section: '', sort: '', Question: [...
0
votes
2answers
42 views

How can I disable a LWC button only if the Omniscript fields are empty?

In Step 1 on an Omniscript, I have two text elements: "neighborhood" and "city". There is also the "Search" button made in LWC. I need it to be disabled only if the ...
0
votes
1answer
31 views

LWC - Owl Carousel - Salesforce Community Help

I'm trying to insert in my community page a owl carousel. I've tried to user different codes and i'm stuck in this for days now. The big problem is that the items of my carousel don't appear on the ...
1
vote
1answer
57 views

Datatable LWC tbody in another component

I am trying to use another component in tbody for a custom data Table in LWC when i use /iterate records in tbody , it is renderinng fine and giving expected result Single Component <template> ...
0
votes
1answer
32 views

lookup for custom object is not working lightning web component

May be its very easy question for you guys but I am stuck badly.when I put object-api-name="Contact" and field-name="AccountId" then its working but for custom object as ...
0
votes
1answer
57 views

Push a new field into an empty obj inside of a JSON payload that has been parsed

Trying to target the empty obj inside of my JSON payload I am parsing with my setter to add a field that my HTML can target to render "No activities" under the lightning-accordion inside of ...
0
votes
1answer
16 views

Render Error HTML without duplicating it in Aura and LWC

I have one Aura and LWC component. I have one custom metadata boolean flag which when turned on will render the error message in Aura and LWC both Like this. Aura: <aura:if isTrue="{!v.isTrue}&...
1
vote
1answer
33 views

Convert or format String with special characters

I'm receiving some answers from an API and they are coming to me like this: There's a way to handle with this since it is coming from the API? I've tried some encodingUtil methods, but I couldn't get ...
0
votes
0answers
27 views

Validation Rule for Lightning Web Component [closed]

my Opportunity object includes a Lightning Component Detail with a field that needs to be validated when setting the opp to closed won. Is there any way I can validate the field in a declarative way (...
0
votes
0answers
23 views

Open 'Chat with an Expert' window in Salesforce Experience (Community) on custom link onclick event

I have build a community and added chat support on the community page. The chat window appears and work perfectly once we click on Chat icon (at bottom right) on the page. Further I am trying to open ...
0
votes
0answers
22 views

NavigationLinkSet can't be reach from LWC component

When I am using NavigationLinkSet object in my apex class, and importing any other method from that class in my LWC component - I've got an error: 'Error:(1, 1) FIELD_INTEGRITY_EXCEPTION - Invalid ...
1
vote
1answer
31 views

lightning-combobox validation - how to reset into no errors

I am building LWC component and have a few comboboxes that some of them are required. <lightning-combobox required="true" label="My combo" options={...
0
votes
1answer
39 views

How to pre-populate user's contact id field on communities using lwc when a page loads

Is there any way to pre-populate the current logged in user's contact in a lookup field in communities using LWC HTML <lightning-record-edit-form object-api-name="CustomObj__c"> <...
1
vote
1answer
46 views

LWC Component not working. Trouble passing parameter to APEX

I have to admit its been a while since I wrote an LWC component. I have the HTML which basically loads a different page (view) depending on if a condition is true. There is one part of my JS which is ...
2
votes
1answer
37 views

Setting focus on conditionally rendered input

In my UI, if I click on a delete button, I show an input field. Now I'd like to set it focused when input is rendered. But it seems like rendering of templates takes few milli seconds if we want to ...
0
votes
1answer
36 views

Payload not getting updated by method in setter

Trying to write a getter and setter method to simply update my JSON payload to have name.first be the student's first and last name so that way the lightning-button can show as their full name, this ...
0
votes
0answers
30 views

I want to add a button add row dynamically in LWC. I have used a field set for fields. How do I do it? [closed]

html: <template> <lightning-card> <lightning-button-icon icon-name="utility:add" size="large" variant="bare" alternative-text="Add" ...
0
votes
0answers
20 views

Write JEST case for LWC component with nested imperative calls

I am passing the data in .mockResolvedValue() method and it is working as expected by providing the correct result. Example : getDataFromApex({accountId : this.accountId}) .then((result) => ...
0
votes
1answer
22 views

Creating record through list LWC

I created record through list but problem is only Name value populated in that object the remaining fields are empty.Maping fields from Object. import cTName from '@salesforce/schema/...
1
vote
1answer
47 views

How can I select elements outside of my component?

I have two LWCs that I have put in a community page. I wanted to select an element of the other LWC from the other LWC, which I currently do not know how. So, basically, my question is that, is there ...
3
votes
1answer
64 views

make LWC's targetConfig's property mandatory

How can I make some properties in the meta file mandatory? I have defined a few properties in below format <targetConfigs> <targetConfig targets="lightning__RecordPage"> &...
0
votes
0answers
14 views

Prevent opening duplicate tabs via NavigationMixin.Navigate()

We're developing a lightning experience app. In the flow, the user can open up multiple subtabs within a main tab. For example, from the main Customer tab (in this example Richard Doyle), there is a ...
0
votes
0answers
18 views

Flow Button Bar error: [NoErrorObjectAvailable] Script error

I am using the Flow Button Bar component on my screen flow. I am using the Navigation Action mode but when I click the button, I always get an exception: [NoErrorObjectAvailable] Script error. Any ...
0
votes
1answer
26 views

Struggling to find correct data-bind structure for JSON payload

I am having trouble rendering multiple for:each loops inside of each other and am pretty sure it is the structuring of how I have it. But I am not seeing where the issue is taking place. So when I ...
0
votes
0answers
24 views

ERROR : There were errors while compiling component

Can anybody please help me out in solving this issue ERROR IN LOCAL DEVELOPMENT ORG : Couldn't find the compiled component. If this component has a dependency on a component in the org or a component ...
1
vote
1answer
38 views

How to wrap cell text properly in datatable in LWC?

I'm struggling with the issue, where cell text in the datatable in LWC isn't wrapping correctly. It obscures the cell from the next column in some cases. I didn't applied any formatting for that table ...
0
votes
0answers
19 views

populate field while submitting lighting form

I am trying to populate few fields before I submit my lightning edit form. But I have a scenario like this question. How to submit a lightning:recordEditForm from a button that isn't nested? So ...
1
vote
0answers
22 views

Get comma seperated values entered as design as columns in LWC

I am working on a lightning web component where i am trying to parse comma separated values(field names) entered in the Columns and add it to an array.but columns givies undefined value. HTML files: &...
0
votes
1answer
33 views

need to capture lastmodifiedBy user and date of LWC in salesforce

I have requirement where i need to fetch modified lwcComponent with the user who modified it programmatically. Is there any soql query we can use or by apex schema we can get it.Audit trail does not ...
-1
votes
1answer
25 views

Banner notification based on time [closed]

We have a requirement where we have to show planned system outages information as a banner. The banner should be visible to users from 4 hours before planned outage time. What would be the best way to ...
0
votes
0answers
17 views

Flow Screen Component LWC - How to maintain internal state on page navigation or page validation error

Problem When creating a LWC FSC, the internal state of the LWC is reset when the user navigates to another page and back, or attempts to navigate to another page but is kept on the same page due to a ...
2
votes
0answers
39 views

How to modify the height of a lightning-combobox dropdown?

I have a lwc combobox and I wanted to control the number of options shown. I tried a lot of CSS and slds existed on the internet but I couldn´t changed it. Could anyone help me? <div class="...
0
votes
1answer
25 views

Adding Row dynamically at multiple table LWC

When I clicked Add button (below method is called) addSectionRecordRow(){ this.skeyIndex+1; this.addSectionRecord.push({ section:'', sort:'', ...
0
votes
0answers
13 views

Is there a way to know the Publisher details in Lightning Message Channel?

I have 5 lightning web componet on my flex page. One of the components like to maintain the list of components and run some business logic on one of the events? I know I can send the component name or ...
1
vote
2answers
28 views

change color of a lightning-vertical-navigation-item-icon

I am building an lwc menu and have a <lightning-vertical-navigation-item-icon label="Sessions" name="sessions" icon-name="utility:event" class="myIcon&...
3
votes
3answers
67 views

Using boolean in custom metadata type to enable/disable console.log in LWCs?

It's considered a good practice to use mdt to enable/disable system.debug info in Apex, meaning: using SOQL to checks the flag at the beginning of each execution. if it's true, then system.debug is ...
0
votes
1answer
17 views

what will be equivalent code for (this.template.querySelector('lightning-textarea').value += '\n';) in aura?

I have written this in aura as var newline =''; newline +='\n'; component.set("v.input",newline); but ...
0
votes
0answers
17 views

LWC/Aura Component Initial Load Takes Long Time [duplicate]

We are able to reproduce the behavior by creating a new sandbox and opening the page, which contains a lot of Aura or LWC components. Second and further page loads are much faster, even after clear ...
0
votes
0answers
9 views

Need to use onChatStarted function in LWC -- Need to get ChatKey

I want to relate Case and Account with my Chat Transcript which I am getting through an imperative apex call. I found a way where it is mentioned-- Automatically associate chat transcript to case and ...
0
votes
1answer
152 views

TypeError: Cannot read properties of undefined (reading 'values')

I'm trying to setup a search filter for opportunity stage field through lightning combo box but however getting an error "cannot read properties of undefined while loading the component" <...
4
votes
0answers
54 views

LWC OSS: How to set properties of components imported dynamically?

I am trying create components dynamically with the help of lwc:dynamic directive in LWC OSS. I am able to create those comments dynamically, but not able to set the properties to them. For each ...
0
votes
1answer
22 views

Lightning input Toggle - LWC [closed]

I’m working with multiple toggles in a template for bucle and I’m trying to find a way to identify the specific toggle that is enabled/disabled, I can’t use something like this: this.template....