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,606 questions
0
votes
0
answers
29
views
modifying lwc property holding data from apex and removing rows, property does not update
Sorry for the confusing title.
I'm working on an lwc for a client that consists of two data tables. It's used to select assets. This client has over 10 million assets and needs to select multiple ...
0
votes
0
answers
14
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
2
answers
47
views
Lightning Tree Grid View: Show Conditional Image as value
Using the <lightning-tree-grid> view I would like to show conditional images as values.
I do know how to change the CSS but I haven't yet figured out how to make conditional images show ...
-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 ...
-1
votes
0
answers
28
views
Lightning Tree Grid: Group Headers in Bold (styling)
I have a Lightning Tree Grid component <lightning-tree-grid> and I would like to make the groups show in bold when grouping by them.
See screenshot attached below. Currently Group A and Group 1 ...
0
votes
1
answer
88
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 ...
0
votes
0
answers
23
views
Ligthning map : Description map markers doesnt accept href
In aura component
<lightning:map
mapMarkers="{! v.mapMarkers }"
markersTitle="{!v.markersTitle}" />
Js :
mapMarkers.push({
location :...
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
1
answer
56
views
Why is my Jest equality test failing when the Expected and Received strings are equal?
I'm using what appears to be a simple Jest test, but when run this test
expect(span.textContent).toBe('OK: Test Message');
it fails even though the strings are equal.
Here's the test
it('should ...
0
votes
0
answers
39
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
51
views
How can I test an array @api annotated attribute in a Lightning Modal component?
When I define the value for my @api-annotated method, the value shows up as empty ([]) on the test.
For example:
const element = createElement('c-my-modal', { is: MyModal });
element.listProperty = ['...
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
64
views
Duplicate API calls on HTTP Post
I'm getting duplicate API calls on a cloud page that uses http post method. User clicks a button in a previous page and lands on the page with the below code. Here's the code I use:
var url = ...
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: '...
1
vote
1
answer
271
views
"Send Email" action popup from a button in LWC
Im writing an LWC that generates emails using context of current Case using prompt builder. Im done with the part till getting the G=generated email into the LWC, and I want to be able to click on ...
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
1
answer
119
views
Lightning Tree Grid: How to apply sticky header?
How to apply sticky header to the Lightning Tree Grid component? I was trying to use position: sticky; on the <thead>, but no luck so far.
I also tried multiple other things including using the ...
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
1
answer
388
views
Trying to generate pdf from LWC using specifically the jspdf html method
We need to generate a pdf with several tables in LWC with custom styling from multiple objects and also embed dynamic images(using base64). We can achieve all of it using VF page, except for embeding ...
0
votes
0
answers
27
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
92
views
How to make Pagination for Lightning Tree Grid View based on Children?
For grouping I use <lightning-tree-grid. I would like to add Pagination for children when groups are expanded.
Currently I have pagination for the first level only.
Let's say I have:
Group A (11 ...
0
votes
1
answer
82
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 ...
0
votes
1
answer
94
views
Report Not Filtering by Project Name in Experience Cloud Using LWC
I have a Lightning Web Component (LWC) deployed in an Experience Cloud site that allows users to view reports filtered by a project name. The component is placed on a project record page (object: ...
1
vote
1
answer
117
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
33
views
Has anyone successfully executed this kind of Salesforce OAuth + query via SSJS inside Automation Studio?
I'm trying to use SSJS in a Script Activity inside Marketing Cloud Automation Studio to retrieve lead data from Salesforce using the REST API. I've confirmed that the credentials and API call work ...
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
184
views
Open Flow in Modal inside FlexiPage with ListView
So I have a FlexiPage with a ListView of Service Objects and a Flow.
Now I want to keep the ListView as the original SF Listview but the flow I would like to move behind a button and inside a popup.
...
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
1
answer
45
views
Dynamic render of template using for:each iteration and saving values with lwc javascript
My requirement is to display the question records based on datatypes which were stored in a custom object as records & capture its responses as well . I was able to retrieve & render the ...
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 ...
0
votes
0
answers
59
views
LWC - Lightning Tree Grid
I need to build a hierarchichal table that shows records from customObject__c as parents and as childs records from the same customObject__c that are related through lookup field_A.
The fields from ...
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: '...
1
vote
1
answer
174
views
Lightning tree grid: click on row to open record
How do I make the Tree Grid rows clickable and navigate to a record using the ID?
In this example page, I can click on the object name to open its record.
What I would like to see is a possibility to ...
0
votes
1
answer
60
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 ...
0
votes
0
answers
144
views
Lightning Tree Grid: Custom Column value and Styling (HTML / CSS)
For <lightning-tree-grid> I have some columns defined. In one specific column I would like to use custom formatting, using HTML, and another column variable.
I am trying to add a green label ...
2
votes
1
answer
577
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
1
answer
168
views
LWC if/else load HTML section not refreshing if condition changes
My LWC has an LWC:if / else condition in the HTML, but the condition is not determined on the initial load so it loads the default. When the js runs through all the code and the condition result is ...
0
votes
2
answers
130
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 ...
0
votes
1
answer
52
views
Make the pagination buttons responsive to mobile screen and browser screen
I have pagination buttons which look perfectly aligned on the browser, but when seen on the mobile application it loses the alignment. I want to make it responsive using slds properties. Below is the ...
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
1
answer
73
views
Slow page loads on lookup records
Our product page is pulling related records (lookup relationship) in a lightning table. There's no other customizations on the tab showing related records, but its over 4-5 sec to load the data.
Data ...
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 ...
1
vote
0
answers
46
views
Cases related tasks are not showing on a LWC
I hope you can help me find what I'm doing wrong here. I have an apex class where I get every Case of the current user account, but I need to also fetch Task (tasks with specific subjects and states) ...
0
votes
0
answers
194
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 ...
0
votes
1
answer
85
views
How to wire to a LWC all the cases (and its related objects) of the current user?
I'm trying to get every Case (and its related objects) of the current user, to show all that data on a LWC. I'm having problems with the apex class.
I know the concept of a wrapper, but I can't get it ...
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 = ...
1
vote
0
answers
69
views
Quill.js features failing after enabling LWS [closed]
I am using Quill.js library as a rich text editor in my LWC for it's mention capabilities. However after LWS enablement in my Org, many features stopped working (example, one of Quills internal ...
0
votes
0
answers
261
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
...
0
votes
1
answer
525
views
Help Need Loading Full Calendar 6.1.15 In LWC
I could really use some help here trying to get Full Calendar 6.1.15 to run in a LWC;
I have Full Calendar zip loaded as a resource in my sandbox:
Name: FullCalendar
MIME Type: application/x-zip-...
-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....