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
0 votes
1 answer
43 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
  • 13
0 votes
1 answer
56 views
+50

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,429
0 votes
1 answer
52 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
19 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
25 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
-1 votes
0 answers
21 views

Lighning record edit form PL value question

I have a form that displays Custom field Picklist values. I am using lightning record edit form. What i want to do is that one of the values, i want to make it read only and not selectable. Example, i ...
darkest's user avatar
0 votes
0 answers
46 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
1 vote
2 answers
99 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
  • 171
0 votes
0 answers
20 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
34 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
  • 49
0 votes
1 answer
37 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
35 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
0 votes
0 answers
19 views

Get HTMLParagraphElement properties in LWC

I am using the leader-line library in salesforce (https://github.com/anseki/leader-line/tree/master). And I have this code <template> <div class="app" > <div class=...
Mauro Adrian Rivero's user avatar
-2 votes
1 answer
36 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
0 votes
1 answer
49 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
  • 507
0 votes
0 answers
75 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
66 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
20 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,235
-1 votes
2 answers
34 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
51 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
32 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
35 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
36 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
  • 21
0 votes
1 answer
82 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
108 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
58 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
0 votes
1 answer
52 views

LWC help with grouping records

I am trying to group records by category. My Controller returns a list of records and the results are as follows: List<AssetsIncome__c> = [SELECT FileTitle__c, FileLinkId__c, FileExtension__c, ...
degmo's user avatar
  • 61
0 votes
1 answer
31 views

SSJS to update query definition - stringify individual column names with loop

We have a script activity in automation studio to update the text of a query definition and target a new data extension. It currently selects all fields using the standard SELECT *, but we need to now ...
TCassa's user avatar
  • 824
0 votes
0 answers
73 views

How to check if a today's date is between two dates using AMPScript in SFMC?

Background: On a cloud page in SFMC, I am trying to display a message if today's date is between start and end dates that are coming from data extension. Question: How can I perform a check and see if ...
kuml2's user avatar
  • 305
0 votes
1 answer
27 views

help with UpdateSingleSalesforceObject with server-side Javascript script

I want to perform data updates based on data that is in a DE, if the Contact_Id of the case is the same as what is in the DE then perform the modifications that are in the variables but when I run the ...
Henry Cast's user avatar
0 votes
0 answers
35 views

Checking if SalesforceInteractions has been initialized

I'm attempting call to SalesforceInteractions.sendEvent outside of the init function's promise resolution. I would like to be able to check to make sure the object has been initialized before ...
james28x's user avatar
0 votes
0 answers
30 views

Is it possible to show button to display a link on email templates in Salesforce

I have a classic email template where I am sending a link to a survey invitation to users. Due to some privacy laws, the link should only show up on the email, when the user clicks on a button 'Ok to ...
it-nish's user avatar
  • 11
0 votes
1 answer
33 views

Nested for:each Loop to render Data in LWC

let fieldConfigs = [ {"fieldApiName":"Id","label":"Id"}, {"fieldApiName":"Full_Name__c","label":"Full_Name__c"}, ...
Akash S's user avatar
1 vote
2 answers
82 views

Incorrect data displayed in lightning datatable

I have a LWC which takes value from 3 input fields and passes the value to a separate component with lightning datatable via LMS. I am able to pass the data for the first time but when I try to repeat ...
code234's user avatar
  • 145
1 vote
1 answer
98 views

How to fetch value from Static Resources

I am new to LWC and i have a Opportunity picklist StageName, i have stored stagename value changed to different language in static resource, now i want to fetch value from static resource and display ...
Shejal Raut's user avatar
0 votes
1 answer
31 views

Use of Internationalization Properties without using custom label

I have created progress bar indicator and the value i.e. 'qualification', 'need analysis' should change according to user profile/language but it should be dynamic, i dont want it from custom label ...
Shejal Raut's user avatar
0 votes
0 answers
57 views

How to hide address fields and just show address lookup on lightning-input-address?

I am able to use <lightning-input-address> to create a way to use address lookup functionality to prepopulate address fields. However, we want to hide the address fields and just show the ...
usernameabc's user avatar
-1 votes
1 answer
21 views

I am not getting sum of fields countOfDesine countOfImplement.. Please helpme

JS onchangeDesign(event) { var fieldName1=event.currentTarget.value; console.log('itemList11'+fieldName1); // this.itemList[event.currentTarget.dataset.key][fieldName1]=event.target....
udaykumar sangepu's user avatar
-1 votes
0 answers
57 views

I am fetching list of records from Object and trying to display in combo box but unable to pass the values?

import { LightningElement,wire,track } from 'lwc'; import getFolder from '@salesforce/apex/EmailTemplates.getFolder' export default class AddTempalte extends LightningElement { value =...
sfdcram's user avatar
0 votes
1 answer
77 views

how to access clientside code object in handlebar in salesforce marketing cloud personalization web template

I am trying to develop a timer clock in marketing cloud personalization web template and i am kind of new to salesforce. right now, i have a date set in serverside code as below: export class ...
craigg's user avatar
  • 3
0 votes
1 answer
78 views

How do I subtract dates in LWC's JS?

I am developing an LWC. I want to subtract two dates and get the number of days between them so that I can conditionally render HTML based on the result.One of the dates is a field Here's my current ...
Vinay Temburnikar's user avatar
1 vote
1 answer
89 views

How to uncheck all checked boxes in lightning-checkbox-group in lwc on button click?

I have a lwc checkbox group. I have a cancel button where I need to uncheck all the checkboxes. The checkbox group shows data correctly but my code is not working and nothing happens when I click the ...
amitsingh6651's user avatar
0 votes
1 answer
65 views

I have a req to show different date time values based on different condition. One to display time in ISO, then in full date along with time & zone

I want to display time in 3 different formats, along side follow the translation strategy as well. That is if user selects to translate the page, user should be able to see the date in his/her local ...
SF Learner's user avatar
0 votes
1 answer
55 views

How to break out of the promise chain for a subsequent method after calling an Apex method in LWC?

getInformation() calls Apex imperatively which in turn makes an external callout. Once the data is received, I want doSomething() method to run. But I don't want doSomething() to run within the ...
Akif's user avatar
  • 15
1 vote
2 answers
57 views

Cannot pass text from LWC to Apex Class

I'm attempting to pass text from a lightning-textarea to my apex handler. I'm still getting null values for the message, but am not sure why. Any help would be greatly appreciated. HTML: <...
kai998's user avatar
  • 49
0 votes
2 answers
37 views

I have a checkbox toggle in my child component, in which I am sending my parameter from parent component. But it's unable to read in HTML

Variable value which I am sending from parent component is getting it's value in child component but it's not getting read in HTML. As, in HTML I'm reading it via for each loop because I am having 3 ...
SF Learner's user avatar
0 votes
1 answer
31 views

Algorithm to calculate Risk Rewards ratio in trading?

Currently, I am developing a trading calculator where I need to calculate the ratio between Risk and Rewards (Risk:Rewards). But I am getting the ratio value in decimal (0.21) as I am directly ...
Zayn's user avatar
  • 9
0 votes
0 answers
53 views

Apex and LWC Communication

Apex methods which are annotated with @AuraEnabled are accessible in LWC. But a TypeScript file is created for that Apex class whose method is marked as @AuraEnabled, And in this TS file the method is ...
Rohit Singh's user avatar
0 votes
1 answer
134 views

Unable to scroll the record page after closing the LWC pop-up window from save button

I have a Aura component on custom tab of Account Record page , on Aura button click opens a LWC pop-up to create custom object record. After saving the record, the pop-up will close but the scrolling ...
Anjali's user avatar
  • 247
0 votes
0 answers
37 views

LWC Controller creates record with combo box but not lookup

So I have an LWC component. I've put a child component lookup input and 3 other number and text input fields in a repeating section on HTML, that works great. <div class="slds-col margin-...
Rufus K.'s user avatar
  • 505

1
2 3 4 5
111