Questions tagged [lwc]

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.

503 questions
1
vote
0 answers

Handle the actions after clicking Save button for standard new/edit record modal

I have a custom lwc component, with a new button. I am using NavigationMixin to leverage the standard new record creation form on pressing the New button on the custom component. Is there a way where I can control the actions to be performed after I…
anish samant
  • 183
  • 1
  • 4
  • 13
1
vote
1 answer

How to get the URL to a specific record page in render function?

I am trying to generate the dynamic URL to redirect to record but it appends the id to the current page. For example, I am getting this: https://nishant-aishwarya-1234-dev-ed.lightning.force.com/lightning/page/0062w000003ar1dAAA/view I want…
1
vote
1 answer

How to jest test lightning-pills in LWC

It's the first time I'm using jest tests and I'm trying to test a method that generates lightning pills from a query of groups with access permissions (array). The lightning pills get updated whenever a new group is either added or removed from an…
user35317
  • 11
  • 2
1
vote
3 answers

Refresh Datatable in for:each loop: Lightning Web Components

I am having trouble refreshing a Datatable in my Lightning Web Component after updating a record. I am calling an onclick action on a button within the row, and imperatively calling an Apex method to update that record. I then call the refreshApex()…
rvmorada
  • 11
  • 1
  • 2
1
vote
1 answer

Call js method from jQuery function

I want to call handleContextEdit method from eventRender function callback I have tried with this.handleContextEdit(event); but it is not working. Please help me out. export default class FullCalendarJs extends LightningElement…
1
vote
2 answers

lwc-services is not recognized as an internal or external command

I am trying to run a hellow world app in LWC open source and after "npx create-lwc-app my-app" when I cd in the dir and run "npm run watch" I get the below error. E:\Development\LWC\workspace\dev>npm run watch > dev@0.0.0 watch…
user614946
  • 599
  • 5
  • 10
  • 27
1
vote
1 answer

After deploying a fully functional Aura Component Bundle to some other environment, it always throws error 'Cannot read property __ of undefined'

I have a Aura component bundle and its Apex controller. I deploy the same to some other environment. It gives this component error 'Uncaught Error in $A.getCallback() [Cannot read property '' of undefined] Callback failed:…
Sakshi K
  • 27
  • 1
  • 2
  • 4
1
vote
1 answer

Salesforce LWC - error message when using querySelector on a datalist element

I'm writing a lightning web component in which I have to assign a element to one of my elements' list property, in order to bind them. For some reason, this JS line: const streetsListId =…
Koby Douek
  • 16,156
  • 19
  • 74
  • 103
1
vote
1 answer

Embed Lightning-input with lightning-icon in LWC

Can someone help with sample of embedding the lightning-icon inside a lightning-input in LWC
user2463287
  • 31
  • 1
  • 6
1
vote
0 answers

Closable custom Lightning tabs in Salesforce

Is it possible to create closable lightning:tab? Following is the code snippet for lightning:tab but there is no out of box event/method to handle tab close operation.
1
vote
2 answers

How to avoid errors from onchange methods on lightning-input?

I'm trying to learn the basics of Lightning Web Components and I'm having trouble getting the value of a lighting-input element. I understand that it's designed for one way data binding instead of two way (a decision that I find questionable), but I…
Matt Gween
  • 177
  • 2
  • 12
1
vote
1 answer

SyntaxError: Cannot use import statement outside a module in JEST LWC

I am trying to test my first lightning web component using visual studio code as my IDE. As instructed I installed Node.js, npm and jest dependency. But I am getting this error Error Image when trying to run the below…
Rupal Desai
  • 19
  • 1
  • 9
1
vote
4 answers

Navigate from one LWC to another LWC

I have two lightning web components and I have to navigate from one LWC to another LWC on button click.  I tried navigation service to apply the NavigationMixin function in the component’s base class to extends NavigationMixin(LightningElement). but…
Lavi__c
  • 47
  • 6
  • 15
0
votes
0 answers

Salesforce B2B Commerce (LWR) - "global.css" style

I'm quite new to B2B LWR, but I'm not new to web development in general. I'm trying to understand what is the best way to have like a global.css (general css styles) and then particular css styles at LWC level. So with B2B Commerce (LWR) I was…
0
votes
0 answers

Salesforce LWC not working for File Upload

I am trying to use package to upload the file into s3 but it is not working as expected , I have tried multiple way's for it but i really can't find any solution, HTML