Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [js]

The tag has no usage guidance.

48 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
377 views

How to correctly enable Type checking in VSCode for LWC?

I wonder how to sucessfully configure type checking in VSCode for LWC. VSCode has JS/TS compiler that support type checking when we set jsconfig.json with compilerOptions like below: "...
Grzegorz Połuch's user avatar
2 votes
0 answers
736 views

undefined value from html button value attribute

I am iterating an array in template and on the button click I am trying to get the value of selected element but the value coming is undefined <template> <template for:each={pages} for:...
Anzar's user avatar
  • 954
1 vote
0 answers
34 views

dynamic css changes based on selection from dropdown

in this code, based on value from drop down i am tryig to change some css, it is removing css but while selecting another value from dropdown it is not adding css again. handlePaymentTypeChange(event){...
rahul soni's user avatar
1 vote
0 answers
144 views

How do i set the value of a custom column via a LWC

I am trying to set the value of an custom checkbox field for the cart component, so that it can be mapped over to Order and OrderSummary. The mapping between cart, Order and OrderSummary seem to be ...
I am not Fat's user avatar
1 vote
1 answer
174 views

Journey Builder/Custom Activity: inArguments data schema

I am developing my first Custom Activity, and struggling with finding the dataschema with description of an available keys (a.k.a. mustache-selectors) for inArguments field in the config.json e.g for ...
Kiryl Ye's user avatar
1 vote
0 answers
1k views

LWC Error Invalid reference

I have js file in the lwc that keeps giving me the Error Invalid reference, but it still works 100%, i just can't make new changes. I would like to add a validation that there has to be something in ...
Brian23Gt's user avatar
  • 119
1 vote
0 answers
851 views

Generate PDF With LWC

Need to save a pdf of the particular div which include Lightning-Datatable. Below are options I don't want to use as workaround: window.print(); Vf redirect(Solutions without Visualforce Page) Tried ...
Shreyash Vyas's user avatar
1 vote
0 answers
1k views

LWC: Render PDF files as images using pdfjs

TLDR: Any working implementation of pdf.js or other 3rd party js to render pdf as images in LWC would be helpful. I want to render pdf pages as images in order to plot dynamic SVGs. Similar to image ...
Pranav Parakh's user avatar
1 vote
1 answer
431 views

Track property do not work properly with Object methods

Setup: @track states = { first: true, second: false }; What I'm trying to achieve: I want to check if this.states has any true values. What I've tried Object.values(this.states).some(v => ...
Rechu's user avatar
  • 452
1 vote
0 answers
132 views

Lightning aura components not rendering as expected

We have a few Aura components in managed package application. There are few drop down selection inputs, few buttons to redirect from one page to another page etc.. Issue is that these input values are ...
AshSFcloud's user avatar
1 vote
0 answers
607 views

How to make a lightning data table button not clickable after click

I have a lightning data table with columns; inside these columns i have a button. My problem is: i want to disable the button after it is clicked, i tried setting the value, but it's like i work on a ...
RettoScorretto's user avatar
1 vote
5 answers
4k views

Cannot read property 'split' of undefined - in LWC js

I have the following LWC, when I try to add on my lightning record page got some error like, cannot read property of split. js: import { LightningElement, api, track } from 'lwc'; export default ...
Poorna.kj's user avatar
0 votes
0 answers
45 views

Need Help with Importing Salesforce Schema for Custom Fields

I've created a custom picklist called Discount_Type__c within the Opportunity Product object. Despite using the appropriate schema import statements in my JavaScript code, I'm encountering ...
Sridhar's user avatar
  • 49
0 votes
1 answer
30 views

$A.util.removeClass not working for <tr>...</tr>

I am trying to hide or show the table rows by clicking on first row with the below code of Aura component. But neither addClass, removeClass or toggleClass works for me. Am I missing something? HTML: &...
Akash's user avatar
  • 361
0 votes
1 answer
34 views

lightning-spinner does not show up when a js function is working

Here is my code // Need to use the result from Promise but it is coming false const validateCompleted = await this.validateData(data); if(validateCompleted){ ... } // When validating data, I want ...
batuayyildiz's user avatar
0 votes
1 answer
135 views

Call apex method from LWC with parameters after record creation

I am inserting data to a custom object through LWC. I want to call an apex method from the JS with the Id of the newly created record and current user's email address. Apex Method: @AuraEnabled(...
Goat123's user avatar
0 votes
0 answers
54 views

loadScript in LWC throwing error - because of location object

I am using a third party library which is using global location variable and it throw the error when run that js code using loadScript in lwc. I wrote a few lines of below custom js code to run as ...
Gopal's user avatar
  • 310
0 votes
0 answers
151 views

$Lightning.use() function with access token

Hello Community Experts, Whenever I use the access token into the $Lightning.use() function, It will give the Invalid session ID error and my component will not load on an external site. I have ...
Tushar Jadav's user avatar
  • 1,818
0 votes
0 answers
95 views

Salesforce CPQ: JS Calc working and returning values in backend but values are not reflecting real time

I am using the JS QCP Plugin to update the QLI level field value then that value is referenced in a price rule of event On Calculate I tried wrapping up the query in a new promise return but still, it'...
Pratik Pawar's user avatar
0 votes
0 answers
62 views

Downloaded folders with files (as zip) don't open

I have a little problem. I compress files in zip and download its. Everything is ok, but files (pdf, png, jpeg...) don't open. I use this script: async downloadFolder(folder) { const zip = new ...
Nazar's user avatar
  • 35
0 votes
1 answer
73 views

Get method returns undefined value in loc, using getRecord @wire adapter

I have an issue with proper passing of the value, getting undefined errors. Would appreciate any input. Parent Componen import { LightningElement, api, wire } from 'lwc'; import { getFieldValue, ...
MatejN's user avatar
  • 31
0 votes
1 answer
40 views

How to use <force:previewPanel aura:id="previewPanel"/> in aura component?

I am getting this error while using this code in aura compopnent Error:Failed to save ObjAttachment.cmp: No COMPONENT named force:previewPanel found: Source Thanks in advance.
Harsh Kumar's user avatar
0 votes
0 answers
47 views

Need to merge required js files in one js file

We are using a js library in our vf page by referencing the static resource where it is stored. While upgrading to its latest version, the js file has many dependency on the required js files in its ...
goose's user avatar
  • 81
0 votes
0 answers
378 views

addEventListener not working in script tag - Static Resources Salesforce

We are trying to implement recaptcha. We are using static resources for recaptcha events instead of writing those in the head markup. We have the following function in lwc: @api verify(callback) { ...
Muskan Agarwal's user avatar
0 votes
0 answers
93 views

Pass a record from object to salesforce community

I created this object containing FAQs. Later I created a lwc component that should pass me the FAQ in this object in my community, but rightly if in "getRecord" I put "$ recordId" ...
Giuseppe's user avatar
0 votes
0 answers
110 views

LWC: how to go back to default value from <c-publish-cmp>?

If I press the cancel button, I want to reset the value of the combo box made using the tag. I tried two methods, this.template.I tried both querySelectorAll() and value=null; but it didn't work at ...
Yeonbi Ji's user avatar
0 votes
1 answer
280 views

What extension would you suggest for Visual Studio Code to make development easier?

So I've been working on a project where are lots of lwc component and it's now hard to quickly understand where one component change data and pass it to another one. Are there any good ways or ...
SBN's user avatar
  • 21
0 votes
1 answer
107 views

How to update data on unrelated components?

So I have two unrelated components on one page. And when items are added\deleted on the first one they need to be displayed in second component. I use this: eval("$A.get('e.force:refreshView')....
SBN's user avatar
  • 21
0 votes
1 answer
34 views

what is fourth item we are passing to js method?

this is my code here: handleKeyUpOnNewRecipient : function(component, event, helper, recipient){ component.set("v.recipients", _.unionBy(component.get("v.recipients"), [...
goel123's user avatar
  • 15
0 votes
0 answers
2k views

NotAllowedError : The request is not allowed by the user agent or the platform in the current context

Hello, I develop a LWC in a comunity which calls a VF page inside an iFramce to read a QR code (not directly in the LWC because of the DOM). This is the JS library I use to scan the QR code: https://...
Oupat's user avatar
  • 733
0 votes
0 answers
4k views

Navigate to external url from LWC (iframe)

Pretty new to LWC I have a site that I wrote with LWC: VF page -> Aura -> LWC. This site is a form that is used on an external web page. I'm trying after submitting the form, to navigate the ...
Salvation's user avatar
  • 1,189
0 votes
1 answer
364 views

How can I get an error msg from the lightning-file-upload component?

How can I extract an error msg from the lightning-file-upload component when it gets a wrong file format? I'd like to catch it and show in a different place. <lightning-file-upload name="...
MirniyPirojok's user avatar
0 votes
1 answer
775 views

LWC html tries to load data before it is completed

Outline: aura component controller is creating a LWC component (data-table) inside of a created tab: aura js: viewContent : function(component, event) { console.log('viewContent invoked'); ...
sfBruce's user avatar
0 votes
0 answers
174 views

How can I make navigator.geolocation.getCurrentPosition work on deployed app

I am building a Next-js app that should work only within a specific geo-radius. I am using navigator.geolocation.getCurrentPosition to get the current location of the user. When I test the app locally,...
David's user avatar
  • 101
0 votes
1 answer
352 views

Working on LWC component using Aura. Scan printer on local IP showing error

Working on LWC component using Aura. Getting an issue when calling zebra print function to find printer on local network. (same code working on lightning component) code is added in 'staticresource/...
Developer's user avatar
0 votes
1 answer
4k views

Dynamic Lightning Web Component Lightning-Card Title

Over the weekend our org received the Winter 22' Release which impacted some of our custom LWC. I have a handful of Lightning Web Components that dynamically display/update a title. Before the release,...
Max's user avatar
  • 486
0 votes
1 answer
76 views

Add Lightning Avatars into a list of Different Results from a Customized SearchBar

I have a search bar which is showing the Users, Queues and Public Groups from the ORG, when you start typing on the search bar the different objects start to appear. I want to show the results with ...
j1992b's user avatar
  • 29
0 votes
1 answer
1k views

Sending an event when window.location.href changes

My setup: I have a LWC which is placed in Shared Footer, so I don't have to add it manually on every page. This component is responsible only for sending events. What problems do I have: I need to do ...
Rechu's user avatar
  • 452
0 votes
0 answers
138 views

Why are the column names of my table not displayed?

//html <lightning-datatable key-field="Id" data={dataForDisplay} hide-checkbox-column columns={columns}> </lightning-...
unique user's user avatar
0 votes
0 answers
349 views

Drag`n`drop in Salesforce mobile app

Did anyone managed to use drag'n'drop feature in Salesforce mobile app (LWC)? I tried Sortable js, and simply adding draggable='true' as well, both work on Salesforce desktop version and on mobile ...
Maciej Król's user avatar
0 votes
1 answer
522 views

LWC unit testing, Dynamic row level actions tests

I implemented dynamic row level action as mentioned in documentation getRowActions (row, doneCallback) { const actions = []; if (row['status'] == 'Active') { ...
shaked mezuman's user avatar
0 votes
0 answers
51 views

How to set field width fits with its content

I'm very new to start learing Aura component and LWC I have to use lightning:datatable to create a list view in related section. JS file's content: init: function (component, event, helper) { ...
hideo's user avatar
  • 1
0 votes
1 answer
3k views

How can I get pass a value to a js method that was entered in html (LWC)?

While experimenting with LWC I wrote the following code: <lightning-layout-item size="1"> <div> <...
unique user's user avatar
0 votes
1 answer
300 views

Display number in table where there are two iterations

I am trying to display numbers in a table where there are two iterations. but if I use indexVar attribute the numbers are not displaying in sequence. Is there any solution to it? Is there any other ...
Cherry Mittal's user avatar
0 votes
1 answer
15 views

exported object isn't available

Let's say we have LWC export const PROGRAM_TYPE = { ISV : 'AppExchange', SI : 'Consulting' }; and import PROGRAM_TYPE from 'c/pdxConstantsCommon'; inside parent component. but i'm not able to ...
pincet's user avatar
  • 909
0 votes
0 answers
1k views

LWC lightnig input type date max value dynamically

LWC lightnig input type date max value dynamically I'm trying to add max Date as 2 years from now. Getting the error ass add_years is not defined Any suggestion would be great.. Html: <lightning-...
Jairam's user avatar
  • 25
0 votes
1 answer
486 views

Import/Load CSS or JS file from File Attachments instead of Static Resource in LWC

I have different css files for each record, which will be stored as a file(ContentVersion). I want to load that css in lwc. But getting this error. Refused to apply style from '' because its MIME type ...
Mohammad Tajammul Ahmed's user avatar
-2 votes
1 answer
741 views

Filter data on client side js in LWC

I have list of data like below format { "Category__c":"SUV", "Control__c":"Automatic", "Description__c":"Lorem Ipsum is ...
user2943892's user avatar