Questions tagged [javascript]
Javascript is a weakly typed interpreted programming language primarily implemented by web browsers to allow for client-side scripting. It can be used in Visualforce pages to give a more dynamic experience to end users. Additionally, the Visualforce engine generates and uses JavaScript to support the functionality of some of its components.
5,607 questions
0
votes
0
answers
10
views
Lightning Tree Grid - Detect Column Width Change
How to detect when a user changes width of columns?
I would like to use an event handler for this so I can save the new width of columns into localStorage and set initialWidth of columns to stored ...
-1
votes
0
answers
23
views
Error: The Content Security Policy directive 'report-to' contains more than one endpoint
How to get rid of this error showing up in the console on any and every page in Salesforce?
The Content Security Policy directive 'report-to' contains more than
one endpoint. Only the first one will ...
0
votes
1
answer
86
views
Issue with using FullCalendar.IO 3rd party lib in LWC
I followed the instruction present in the website to use FullCalendar - https://fullcalendar.io/docs/initialize-globals . I downloaded the zip file and compressed just the index.global.min.js and ...
1
vote
0
answers
40
views
lightning map doesn't render properly
@wire(getNearbyAccounts, { accountId: '$recordId' })
wiredAccounts({data, error}) {
if (data) {
const baseUrl = window.location.origin;
this.mapMarkers = data
....
0
votes
0
answers
38
views
How to add filters to Tableau Viz lauched from a Lightning Web Component with Embedding API version 3?
I am following this article which lauches the Tableau Viz from a Lightning Web Component -
Tableau Insights Delivered Directly to Salesforce with Dynamic Data Security
This uses Tableau Embedding API ...
1
vote
1
answer
69
views
How to trigger <lightning-record-edit-form> validation without actually saving the record?
I’m building a LWC that uses to edit an Account__c record. I need to run all of its built-in client-side checks (required fields, data‐type and length validations, etc.), but I do not want to ...
0
votes
0
answers
34
views
Problem with passing parameter from OPENCTI to Flow
I created a method that opens Screen Flow for me. The script is below.
window.sforce.opencti.screenPop({
type: window.sforce.opencti.SCREENPOP_TYPE.FLOW,
params: {
flowDevName: '...
0
votes
0
answers
28
views
How to call onclick events written on div through jest (salesforce)?
I have implemented a div in html file and calling the js function using the onclick event as shown below. how to cover 'onclick={handleShowMoreClick}' through jest?
Every time I am getting error ...
0
votes
0
answers
30
views
Use Third-Party JavaScript Libraries - Swapy
I am trying to use Third-Party JavaScript Library Swapy in a LWC.
but I get error on the load script
<template>
<div class="list-container">
<ul id="swapy-list"&...
0
votes
0
answers
25
views
Opening telephone numbers in a LWC in Mobile Publisher
We have a Mobile Publisher app and a LWC in it. Our LWC needs to open a telephone number in the dialer on button click. The following Javascript code, however, throws the error Window.open supports ...
0
votes
1
answer
81
views
How to post client side and server side at the same time with pardot?
I have been running in circles with trying to figure out how to send pardot a tracking post, but at the same time complete my regular registration form in my ASP.NET webpage. I cannot use, or pardot ...
1
vote
1
answer
116
views
Refresh child LWC component
Problem statement
I have an LWC component that display list of contacts. Upon selecting a contact, there is a child LWC component that loads records from its related record- custom permissions (a ...
0
votes
0
answers
58
views
Migrating from AWS JS SDK V2 to V3
Has anyone moved from AWS JS SDK V2 to V3? I'm trying to do it. Used webpack to bundle client-s3 and s3-request-presigner. Uploaded that as a static resource. Used the following to load it
import { ...
0
votes
1
answer
71
views
On Record Detail Page, custom LWC should refresh data when field update is saved
I created this custom LWC. When user updates and saves Specialty on the EA Record Detail Page, I need my Compensation LWC to refresh the data. I have tried a number of things, but every time I have to ...
0
votes
0
answers
16
views
Is there any way to avoid/replace localStorage on CPQ QCP?
I'm trying to force a CPQ calculation with Apex, but on the QCP I'm using the LocalStorage for another functionality, so when the calculation gets triggered from Apex, I'm getting an error that says ...
1
vote
1
answer
95
views
Lightning Tree Grid: Display data as 'url' but groups as 'text'
To display the first name of a member in the first column of my <lightning-tree-grid>, I am using type url to make it clickable, navigating to its record.
{ label: 'First Name', fieldName: '...
0
votes
1
answer
59
views
Lightning Tree Grid: Remove padding left on first column
The <lightning-tree-grid> implements a padding on the left side of the first column. The other columns do not seem to have this padding.
Is there a CSS property or an HTML property that I can ...
2
votes
1
answer
575
views
Is Scrolling Supported in LWC Modal?
I am using a lightning-modal and having a hard time getting it to scroll at all. I'm using pretty simple markup, similar to the docs.
<template>
<lightning-modal-header label="My ...
0
votes
2
answers
127
views
Format currency value LWC
How do we format currency value to look like this
I'm displaying the value with 3 decimals currently, but the ask is to move the third decimal like the format above.
I tried following code but didn't ...
1
vote
0
answers
37
views
Javascript "debugger" keyword being excluded/stripped off from LWC
Is there a new setting for serving LWC components in developer/debug mode?
I have this LWC with a simple button and handler method with the Javascript debugger keyword, which I've used on so many SF ...
1
vote
0
answers
41
views
What JavaScript changes are required for Spring '25, eg: event.target.getAttribute('id') vs event.currentTarget.getAttribute('id')
I have noticed in Spring '25 that legacy Aura code that is invoked from a button click that leverages the method event.target.getAttribute does not work anymore.
However, in Winter '25 sandboxes, this ...
0
votes
0
answers
192
views
How to freeze column jquery data table
In lightning-datatable, the freezeColumn feature is not available. I attempted to use a custom Lightning datatable, but I wasn't sure how to implement it effectively. As an alternative, I implemented ...
1
vote
1
answer
101
views
LWC bypass apex limits when getting base64 of contentDocument
I'm trying to bypass apex limits when trying to get the base64 content of a content document
Sample code below
fetchFileAsBase64(contentVersionId) {
this.isLoading = true;
this.error = ...
0
votes
0
answers
256
views
How to Use Markdown in LWC
I'm trying to make markdown js work in LWC but haven't been able to do it. I keep getting the below error from browser
markdownPreview.js:1 Uncaught (in promise) ReferenceError: marked is not defined
...
-2
votes
1
answer
54
views
After enabled LWS in sandbox windows.location.hostname is returning null
I am unable fetch the base url using window.location.hostname due to LWS being enabled in the sandbox. If LWS disabled it workings fine. Any solution would be much appreciated.
alert(window.location....