Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 72832

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.

1 vote
Accepted

My lightning web component successfully loads data only under Sys Admin and not as any other...

Since Winter '21, users need access to the apex class of @AuraEnabled apex methods based on their profile. For future reference, if you appropriately handle/display the error message returned from the …
Kris Goncalves's user avatar
2 votes
Accepted

RecordId is not getting populated in LWC JS file

Call Apex Methods Imperatively shows the format for doing this with parameters with this example handleSearch() { findContacts({ searchKey: this.searchKey }) .then((result) => { …
Kris Goncalves's user avatar
2 votes

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

As sfdcfox mentions, I'd also argue console.log and System.debug should be avoided if this is for production debugging. Other than using the debugging tools built into the browser, you can also consid …
Kris Goncalves's user avatar
4 votes

Lightning component tab title stuck in "Loading"

Update: Workspace API for LWC was made beta in Winter '24 so you should now be able to update the title of the tab to not be "loading" with setTabLabel in your LWC similar to how it was done in Aura, …
Kris Goncalves's user avatar
6 votes

force refresh (f5) of a page after LWC quick action

Update: In Spring '23, there's a beta for a new lightning/refresh module that'd be relevant for this use-case now. Whether user-driven or app-invoked, the ability to synchronize data without reloadin …
Kris Goncalves's user avatar
2 votes
Accepted

Deploying LWC to production org

If you're deploying a LWC through change-sets you follow the same procedure as you do for any other metadata type. You include it and any dependencies. There's no exact science as there's differences …
Kris Goncalves's user avatar
3 votes
Accepted

Is there like a warning variant for buttons?

You only get what's available to you through lightning:buttonStateful. The documentation shows the options you have for variant The variant changes the appearance of the button. Accepted variants inc …
Kris Goncalves's user avatar
7 votes
Accepted

Why Import Fields Instead of Use Text in LWC?

As mentioned in the @salesforce/schmea docs, there's many benefits: Salesforce verifies that the objects and fields exist. It'll catch typos of the API name as well Prevents used objects/fields from …
Kris Goncalves's user avatar
1 vote

LWC data shows in console, but for:each fails to display it

It's helpful to look through Understand the Wire Service. You can return the results to a property or function as CyberJus highlighted and shown in those lwc-recipes linked. Depending on which you do, …
Kris Goncalves's user avatar
1 vote

base vs Narrow in lightning-card in LWC

The lightning base components incorporate Lighting Design System (SLDS) markup and classes. The base components handle the details and then provide simple attributes that enable you to provide variati …
Kris Goncalves's user avatar
6 votes
Accepted

How to edit a LWC meta file in developer console?

Unfortunately, you cannot as noted in the LWC documentation. Develop Lightning web components with a workflow that fits your needs. We recommend Salesforce DX tools, but you might be in a situation w …
Kris Goncalves's user avatar
1 vote

Deployment of LWC causes unknown duplicates error in lwc subfolders

LWC, in particular, are quite restrictive in their structure. Salesforce DX Project Structure and Source Format Lightning web components must reside in a directory named lwc under the directory. Ev …
Kris Goncalves's user avatar
2 votes
Accepted

Jest Tests for KeyPress Event

With jest, you end up mocking modules/imports or apis that don't actually exist within the context of the test. That way, when your javascript interacts with them - a value is still returned when its …
Kris Goncalves's user avatar
1 vote

I want to cover the onMouseover event in JavaScript by writing JEST test case in LWC

I'd recommend setting some data attribute to rely on in jest tests to grab exactly what you want versus relying on div/styling. I don't know your flag structure, but I presume it'll have some unique …
Kris Goncalves's user avatar
1 vote

LWC not creating a record in Salesforce

You have a typo when building fields. fields[NAME_FIELD.fieldApiName] = 'Testing'; fields[ACC_NAME_FIELD.fieldApiName] = this.accid; //typo below on field - should be fields field [DUNS_FIELD.fieldAp …
Kris Goncalves's user avatar

1
2 3 4 5
8
15 30 50 per page