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.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
31 views

How to show the selected item in a custom dropdown list?

In my lwc I created a custom dropdown (with a button) because Salesforce combobox doesn't allow images in the options (and I need to add flags images on each option). So I used an html unordered list, ...
kcs's user avatar
  • 1
1 vote
0 answers
24 views

Issue with ConnectAPI.NamedCredential Class

I am trying to utilize the NamedCredential Class. The getNamedCredential method works but the getExternalCredential method does not. I am able to see the external data from the named credential call ...
Mac Nosek's user avatar
0 votes
0 answers
27 views

The state of radiobutton is not stable in LWC. I have created a timer function, when the timer function is over then the value is getting fixed

html part <template for:each={wrongAndRightAns} for:item="answer"> <div class="grid-item" key={answer.key}> <label><input type="radio" ...
Hadi Husain's user avatar
0 votes
1 answer
52 views

How to clear LWC lightning-textarea in javascript

I have an lwc with a simple form which includes a few checkboxes and two selects and one textarea. My submit function does a callout, and then clears the inputs. The rest of the inputs are cleared, ...
hgolov's user avatar
  • 723
0 votes
0 answers
34 views

JSForce connection with connected app returns undefined

I am using the below code to establish a connection with Salesforce connected app - const express = require('express'); //Adding Express const http = require('http'); //Adding http const jsforce = ...
sumchans's user avatar
  • 641
0 votes
1 answer
33 views

Wrap LWC in Aura so it can be opened on click of a button in a pop-up window

I have created the following LWC that creates a record on a custom object. I want to create a button on the custom object list view page, and I want this LWC to open in a pop-up window. It is not ...
Goat123's user avatar
0 votes
0 answers
35 views

Does using Function (an Alternative to eval function in js) will impact Salesforce AppExchange Security Review

In our Second Generation Managed Package, we are using Function() as an alternative to Eval Function as mentioned in this link to evaluate an expression in Aura Component. Does it have any impact in ...
S1th's user avatar
  • 69
-1 votes
0 answers
26 views

To send Marketing cloud Persnolization (Interaction studio) Web campaigns engagement data to utag.link object (tealium) tag with MCP Site Map

I have one use case for a client with Marketing cloud Personalization (Interaction studio). They wanted to send the web campaigns engagement data (Impressions, dismissals and clicks) to utag.link (...
Mahesh's user avatar
  • 1
1 vote
1 answer
167 views

Trouble loading PDF.js lib in LWC

I have trouble loading the PDF.js library in my Lightning Web Component. Whenever I load the page with the component, I get : PDF.js could not be loaded undefined Twice, this additional error popped ...
Domovyak's user avatar
0 votes
1 answer
76 views

How to remove the row from a lightning data table

I want to delete the rows using the utility icon in lightning datatable and I used onrowaction but it's removing all the records from that array list instead of removing them based on the selection id....
Ryan's user avatar
  • 109
0 votes
1 answer
38 views

How to set default picklist value for lightning-combobox?

I have lightning-combobox for which the picklist values are retrieved through getPicklistValues. How can I set default value of this field as the first picklist value? HTML: <lightning-combobox id=&...
coder123's user avatar
  • 105
0 votes
1 answer
35 views

Issue embedding link in custom label in LWC

In LWC, I have below html template which is showing an error message. error message is stored in custom label. <div class="text_container slds-m-left_medium slds-m-right_medium slds-text-...
Sam Rickert's user avatar
0 votes
0 answers
29 views

Video capture in LWR

We have developed some small LWC that start the device camera to take a picture. It uses getUserMedia method in navigator.mediaDevices and works perfectly for internal users in Sales Cloud. When ...
Vladimir Egikyan's user avatar
0 votes
0 answers
24 views

Hi, I created a lwc component to preview and download the pdf [duplicate]

I am creating a lightning web component to preview and download a pdf file it is working fine in lightning record page but when I am using same component on experience builder site page that preview ...
Hritik Thakur's user avatar
1 vote
1 answer
59 views

Datatable inside tabset don't render content in first tab [duplicate]

I have a requirement where I need to dynamically format datatables inside tabs defined by a custom object used to assist in formatting my LWC component. My component has a wire function that calls a ...
Erick Petzold's user avatar
-1 votes
0 answers
42 views

Fetching data from Salesforce through an Http Request in Node.js

I have my own website in React, node, express, and SQL, where I will need to have access to data that is inside of my Salesforce account. I tried multiple things but can't seem to figure out how to ...
Cédric Bélanger-St-Pierre's user avatar
0 votes
0 answers
112 views

PKCE: Invalid Code Verifier

I am trying to implement the PKCE flow into my SPA. I have read a bunch of documentation including the salesforce docs, the RFC for PKCE flow and have watched this step by step instruction from a ...
coderustle's user avatar
0 votes
1 answer
46 views

ssjs System.Collections.Generic.Dictionary`2[System.String,System.Object]

I have a SSJS code that i am running SFMC cloudpages. The code is to do a HTTP.GET call to a url and then parse the JSON response.when trying to write out the result of parse i receive the following ...
sam sfmc's user avatar
0 votes
0 answers
41 views

How to call Intercom Javascript Function within a Lightning Component

Intercom, an in-product messenger has several JavaScript functions including one to show their messenger: https://developers.intercom.com/installing-intercom/web/methods/ We are trying to call this ...
Kevin's user avatar
  • 55
0 votes
0 answers
63 views

LWC lightning-map get current position of center

Im using lightning-map to show account positions. This map has filters to show/hide different types of accounts, that means that the marker list will get updated everytime a filter is changed. The org ...
David Elias Carrasco's user avatar
1 vote
1 answer
44 views

Anyone have a reliable recipe for debugging an LWC running in a Digital Experience in Chrome?

Having read Debug Components in an Org With LWS Enabled and various posts from the last couple of years on debugging problems, I still can't set a breakpoint in the JavaScript of my LWCs contained in ...
Keith C's user avatar
  • 135k
0 votes
1 answer
53 views

Original Array changes when its copy is changed in LWC

So i have a method in my javascript, transformJson(input) which is returning a JSON. The result returned is being used in another method as below: handleFinalJson(){ this.originalVar = this....
JackSparrow's user avatar
0 votes
1 answer
44 views

RefreshApex doesn't update my existing account [closed]

openModal(event) { const row = event.target.closest('tr'); this.siret = row.querySelector('td:nth-child(2)').textContent; const jsonString = JSON.stringify(this.companies.data); // Convert ...
Papa ibrahima SOW's user avatar
-1 votes
1 answer
57 views

Trigger "Leave Chat?" by code

I am working on a custom interface for the live agent widget and was wondering if I could trigger the exit/leave chat by code. Basically, I am removing the X and minimize buttons and want to be able ...
Morkfang's user avatar
0 votes
1 answer
86 views

what is the alternative method "EncodingUtil.base64Encode" in JavaScript or VisualForce?

I have been using EncodingUtil.base64Encode() ; to get base64 contentversion data aiming to send/upload file from salesforce to outside server like AWS S3 which was working fine but due to sfdc ...
Mohammad Zakir Hossain's user avatar
-3 votes
1 answer
62 views

How to get field API Name and Values from an array list to be iterated in the HTML

From the list below, I want to have column in html with FieldApiName(column1) and FieldValues(column2) in HTML. How will I do that with the output list below. that accountIds can have different ...
sFDev_newbie's user avatar
0 votes
1 answer
95 views

Dynamic color based on condition LWC

i want to fill the svg color based on condition JS : get OpptColorIcon() { const colors = this._listOpp.map(opp => { return opp.Scoring === "weak" ? "#FF8C00" : &...
Fark's user avatar
  • 17
0 votes
1 answer
239 views

Need Help with Lightning Tree Grid: Fetching Parent and Child Records on Button Click

I'm currently working on an Aura component that utilizes the Lightning Tree Grid table in Salesforce. My goal is to retrieve both the parent record and its associated child records when a button is ...
Pavan tej's user avatar
  • 1,439
0 votes
1 answer
82 views

How Do I Break Down a JSON Array Format CSV Column Into Individual Columns Within SFMC Data Extensions?

I have an interesting use-case where I am getting a Data Extension from CDP where one of the columns is in JSON Format. Now I want to break down the last column of this DE into its individual columns....
aryashah2k's user avatar
0 votes
0 answers
31 views

Sitemap - Flooring Function & listener on WP-Forms form isn't working

Issue: Form submit isn't capturing MCP data On our flooring page https://www.silvaris.com/products/flooring/ there must be a bug in the function and/or listener. Can you please help? Listener: { ...
Ryan Fox's user avatar
0 votes
0 answers
100 views

Count click of every link in the page

On a record page there is a standard rich-text component. An image is added to the rich-text field and it is hyperlinked. I have to capture the number of click on this hyperlinked image on the page. I ...
Sam's user avatar
  • 238
0 votes
0 answers
75 views

Starting a screen flow inside an overlay modal that I am calling from utility bar using Aura

I have tried going on the LWC route but there is no functionality like overlay library. I have solved this issue using $A.createcomponent. But I am facing a bug while clicking the button for the ...
Satyajit's user avatar
2 votes
2 answers
517 views

Reset Custom Validity On LWC Input on Value Change

I have a lightning-combobox with 2 options. If the user choose value X - then all the form fields are required. If the user choose value Y - the fields are not required. When the user choose value X, ...
Omnia's user avatar
  • 191
0 votes
0 answers
29 views

I am trying to get the current CurrentPageReference on button click from object ,but it is keep taking a old record id

I am trying to get the current CurrentPageReference on button click from object ,but it is keep taking a old record id from cache after the refresh only it is taking the current record ID JS import { ...
Sundar Anbu's user avatar
0 votes
0 answers
41 views

Close window from Visualforce page after action completes

I have a custom button that allows a user to download a CSV of the record currently displayed. To do this, I'm opening a separate Visualforce page that triggers the download by returning a page ...
kai998's user avatar
  • 59
0 votes
1 answer
59 views

Error in Custom Lookup Component

I am struggling to fix the issue in the below look up component. The issue is, when ever user is searching the Account name in the search box , it seems to be stuck and results in missing some of the ...
Shekher's user avatar
  • 11
0 votes
1 answer
84 views

ChartJS in LWC with luxon adapter

I am using ChartJS version 4.3 to draw a chart in an LWC component - this works well. I have LWS enabled (not locker). I would like to use a 'time' based x axis scale to present data with relative ...
Daniel Collier's user avatar
-2 votes
1 answer
120 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
-1 votes
1 answer
61 views

Convert XML to DataTable

I have following XML format returning from API. I need to extract in LWC Datatable. XML 1: <steps id="0" last="4"> <step id="2" type="ValidateStep"&...
Ragul's user avatar
  • 1
0 votes
0 answers
137 views

LWC ChartJs not working

I am building al screen flow-enabled LWC to show a simple line chart (the evolution of a score), but this implementation is unable to pass the data gathered to the chart presentation... (labels and ...
Bernardo Lira's user avatar
-2 votes
3 answers
139 views

How to round 21.87499999999994 to 21.88?

I know this is very specific but is just an example, I already tried: Math.round(Math.round(num + "e+2") + "e-2").toFixed(2, 3, 4..) Math.trunc Math.pow.. But nothing works.. How ...
Alexia Ribeiro's user avatar
0 votes
0 answers
27 views

Push operation using spread operator is not working in Lightning web component

I have a child lwc component which is getting array-data from a parent lwc component. In my child component, I have the following code console.log('this.selectedItems kkkkkkkk ' + JSON.stringify(...
Madhurima's user avatar
  • 1,265
-1 votes
2 answers
74 views

Placing Date.getDate() as an array index return undefined in an LWC

I'm stumped on why this returns undefined. Any ideas? weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; ...
Dylan's user avatar
  • 3
1 vote
1 answer
63 views

Unable to view the data in the datatable

I am trying to display the contact record's Name, Phone & Email field on a datatable by bringing the value dynamically from custom metadata records but when I am adding the component on the page ...
code234's user avatar
  • 145
0 votes
0 answers
37 views

Not able to pass event in Salesforce from Child to Parent

Hi I am trying to pass a custom event from child to parent, but getting strange error. Event Code :- const passEventr = new CustomEvent('recordselection', { detail: { selectedRecordId: this....
Shekher's user avatar
  • 11
0 votes
1 answer
52 views

LWC issue with array variable being blank when accessed from another function

I am building a custom file upload component as follows. I prepare my list of uploaded files inside the function handleFilesUpload. I then call another function called handleSaveFiles but inside of ...
degmo's user avatar
  • 61
0 votes
1 answer
80 views

Prepopulate hidden fields on Offline Support form on Live Chat

Hello I'm developing a Live Chat using the Service Setup "Chat with Customers" wizard. I'm using extraPrechatInfo to hardcode the country of the page I'm embedding the chat button into so ...
banjug's user avatar
  • 23
0 votes
1 answer
133 views

Display array of objects in two columns

I want to display array of objects in 2 columns. what is the easiest method to display the list as two columns? const columns = [ { subHeading: "A", subText: ["1", &...
SFDC Salesforce's user avatar
1 vote
1 answer
711 views

How do you display a js map in LWC

I have a customer apex controller that products a payload with an json apex map of map<String, List>. once i execute the apex method the javascript i convert it with json.parse and load them on ...
Cancel Ed's user avatar
1 vote
1 answer
118 views

add a delay between lwc and apex excecution

I am struggling in one of issue. I have a lwc page where i can upload multiple files and on button click i create filerecords in sfdc and send those files to AWS(Name and some attributes are coming ...
sfdc_to_learn's user avatar

1
2 3 4 5
112