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
0answers
11 views

How to save a text field based on user input

I have created a LWC that displays a table of information for a user. I created a html lightning input, that looks like this. <td><lightning-input key={row.key} data-key={row.key} value={row....
0
votes
1answer
17 views

use of lightning navigate:navigate from one component to another in lightning community

var eUrl= $A.get("e.force:navigateToURL"); eUrl.setParams({ "url": url }); eUrl.fire(); I am trying to replace above in my code as per documentation it is not ...
0
votes
0answers
10 views

AJAX Proxy Basic Authorization

I tried to make a SOAP call to a web service through AJAX Proxy (in a visualforce page) but I can't configure the basic authentication in the header. Does anyone know how to do it? Here is my code: &...
1
vote
0answers
16 views

ActionHub (Mass Edit + Mass Update + Mass Delete) Lightning Customization?

We are currently migrating from Classic to Lightning. Our ActionHub Mass Edit + Mass Update + Mass Delete AppExchange package customizations rely on copy/paste of JavaScript for unincluded default ...
0
votes
0answers
16 views

Lightning data Table onrowaction

I am trying to use lighting Datatable with a button to edit record. I am trying at first to assure that when i click on the button catch the related record. But when i click edit button i got nothing. ...
0
votes
1answer
25 views

Component Helper Async Issue?

I have a component that is using aura:iteration to loop through some data and output a table of results. One column in this table is a link to the record. I created a clickevent handler and a helper ...
6
votes
0answers
36 views

Is it possible to render an LWC template identfied by file name that is only known at runtime? [duplicate]

This Render Multiple Templates code example shows how to pull content from multiple .html files in the same component: import { LightningElement, track } from 'lwc'; import templateOne from './...
4
votes
1answer
18 views

Why do I get a “lwcX is not a constructor” error at runtime?

I have two "headless" LWC modules (LWCs that have no template or CSS and that simply export some items to be used elsewhere). Let's call them "lwcX" and "lwcY". In this case lwcX is the default ...
0
votes
1answer
33 views

Triggering the approval process from JavaScript in Lightning Web Component

I have a quick question on approval process and I would like to get your suggestion on how to implement this particular requirement. We are developing a custom lighting web component for our ...
0
votes
0answers
20 views

FullCalendar v4 events displayed on popover doesn't trigger eventClick method [closed]

I have a custom development with FullCalendar v4 js library implemented. This is my calendar settings object: locale : 'en', plugins : ['dayGrid','timeGrid','list','interaction'], ...
0
votes
2answers
25 views

Open Link in the same window below button in VF page

I am looking for a solution where when I click on a button, the resulting page should open in the same window below the button. Below is my current VF page, right now the page is opening in a new tab. ...
0
votes
1answer
19 views

How to fire appEvent after toastEvent in lightning controller

I have an appEvent on a child controller to update a parent method after a toast. I have set an alert on the parent in the parent method to figure out if my event is working properly. My alert shows ...
0
votes
2answers
29 views

How to get current date on load of a Lightning web component? [closed]

Can you please provide me the best solution?
0
votes
1answer
10 views

Notes not getting saved due to html characters

I am trying to escape all html characters with this function : strNotes.replace(/&/g,'&amp;').replace(/'/g,'&apos;').replace(/"/g,'&quot;').replace(/</g,'&lt;').replace(/>/...
1
vote
1answer
34 views

Getting JSON_Parser_error when using Sfdc.canvas.client.ajax to Create multiple records using REST API

I am trying to insert 2 records at a time using canvas client in a connected app, using REST API, code and response below: Sfdc.canvas.client.ajax('/services/data/v47.0/composite/sobjects',{ "...
0
votes
1answer
29 views

how to understand JSON.stringify value?

Lets say, I have a map created in aura component controller. I want to send map to apex controler but unfortunately map cannot be serialized by JSON.stringify. My code JSON.stringify([...draftValues....
0
votes
1answer
16 views

Cannot assign to read only property 'disconnectedHandler' of object '[object Object]

I am trying to work with a timer in Salesforce Lightning. When I add it to the page, it throws the error of "render threw an error in 'c:serviceConsoleCaseTimer' [Cannot assign to read only property '...
0
votes
1answer
30 views

LWC - Why is the computed rowId for my custom data type in lighting-datatable undefined?

I have a custom lighting-datatable where the last row is a column that contains two buttons. When either of these buttons is pressed, I am attempting to retrieve the rowId of the row where the button ...
-9
votes
3answers
86 views

How to use trim() function in SSJS using data extension in Marketing Cloud [closed]

How do I use trim() functions in SSJS? Using Data Extensions. Can you please provide some examples? I have a Data Extension, where "Message" is an Attribute. In this Attribute how do I use the trim(...
1
vote
1answer
33 views

Add new string value to existing value for text area(long) field with new line using LDS

I am using LDS to load the Account record. i want to add new comments with new line to existing comments for my textarea(long) field in Account record. i used \n and `\r\n' none of them are working ...
0
votes
1answer
36 views

How to force browser to download images

I am using below code in Javascript controller of Lighting Component to download attachments on Case. It's working for pdf and zip files, but images are being opened in a new tab. Is there any way to ...
0
votes
1answer
33 views

overriding lightning:input default error format

i have lightning:input type="date" dateStyle="short" in my component, i want to override the default error message Your entry does not match the allowed format M/d/yyyy. to format must be mm/dd/yyyy ...
-2
votes
1answer
29 views

Need help in Circle Progress Ring [duplicate]

Need to create a circle progress ring that increases everytime on my application, when an input field(answer) is filled for every question.
3
votes
2answers
43 views

Add link on column name lightning-datatable

I am trying to add link on lightning-datatable. But I think javaScript does not accept this syntax this.accounts = data.map(row => { return `{ ...${row}, nameUrl: /${row.Id}}`}) Here is my code:...
0
votes
0answers
12 views

How to close a VFP pop-up window opened using CSMSG.setConfiguratorWindow(parent);

I have a visualforce page that is opened from a CloudSense package lookup page. When in working in lightning, the vfp window needs to be opened using below line: CSMSG.setConfiguratorWindow(parent); ...
1
vote
0answers
32 views

Visualforce <Apex:tabpanel> breaks MathJax (math formating script)

Problem: I am using mathjax to format math equations nicely on a visualforce page. Everything goes great on a naked vf page. <apex:page > <!--script id="MathJax-script" src="https://cdn....
0
votes
1answer
42 views

How to Simulate Button Click in Lightning Aura Component [closed]

How i can simulate click on a multiple buttons from client side controller of the Lightning Aura Component?
2
votes
0answers
55 views

I can't load PDF.js lib in Lightning Web Component

I'm creating an lwc component that shows a pdf with canvas, the lib I'm using is this:PDF,js when trying to load lib, returns me an undefined error, can someone help me how to load correctly My Html ...
1
vote
1answer
47 views

Loop through Large dataset for values

I am having performance issues while looping through large data sets (approx. 10k) records in Lightning component Controller using JavaScript. Below is the object var wrpr = {Account:Account,Checked:...
2
votes
2answers
139 views

LWC - Iterate through rows of lightning datatable using javascript

Are we able to iterate through the rows of a lighting datatable and query each columns value in Javascript? Like this, but for a lightning datatable: https://stackoverflow.com/questions/3065342/how-...
0
votes
1answer
28 views

When I pass a parameter to the JS controller via event.currentTarget.dataset it gives undefined

In an aura:iteration, I pass the selected Order to the JS controller as in the code: <aura:iteration items="{!v.ordersAlt}" var="item"> <tr class="slds-hint-parent"> <...
3
votes
2answers
177 views

LWC: Inside an HTML template for-loop, set loop variable property to new user-typed input element value?

I'm trying to write a Lightning Web Component (yay, first one). Still in the "proof of concept; can I get user input to propagate around the page?" stage. I have a List<MyApexWrapperClass> ...
0
votes
1answer
50 views

SSJS and AMPscript

I'm trying to output message if there is an error and i have very little knowledge in javascript in general. Could I get some feedback on if the following would work or how I would go about : If ...
5
votes
1answer
84 views

LWC - How to communicate property changes down the hierarchy

By following a tutorial (How to use custom LWC lightning component in lightning-datatable) I was able to extend lightning datatable and insert a button into the final column. Now, I am currently ...
-1
votes
0answers
33 views

How to change input field color in LWC [duplicate]

I have a input field as below <lightning-input variant="label-hidden" type="number" placeholder="Calculate" class="inputFieldColor "> </...
2
votes
0answers
35 views

getting issue in setting caret in div with contenteditable true

I'm trying to set caret to a child span of a div with contenteditable="true", Below is the code: placeCaretAt : function(id){ setTimeout(function(){ var test = document.getElementById(id)...
0
votes
1answer
63 views

Update value of picklist in LWC

I am pretty new to JavaScript & LWC. I have two picklists that I am using to filter results. The filters are working independently of each other. I have two questions: How could I set the value ...
2
votes
0answers
42 views

Highlight modified fields in LWC

I have a complex UI that renders multiple <lightning-input> fields. When the user edits these fields, I store the originalValue (usually passed through an @api property), the newValue and the ...
0
votes
1answer
66 views

A button to scroll at the top of the page in LWC

Below Playground I have code with the button to scroll at the top of the page and conditionally render the button when user scrolled down. Now if I remove the custom render thing then button works as ...
2
votes
1answer
94 views

Use of export default for class in LWC

I am new to LWC. If in an interview I am asked, Why do we use export default for class in LWC JavaScript?. What do I answer? Is it done to make the component available for deployment to salesforce? I ...
1
vote
1answer
30 views

Component event not being caught

It looks like the event is firing but the handler is not catching it. How do I go about getting this component event to be handled? EVENT: <aura:event type="COMPONENT" ></aura:event> ...
0
votes
0answers
16 views

What does ACTION_ENDPOINT_CONTENT do?

I can't find these in any of the docs: ACTION_ENDPOINT_CONTENT and ACTION_ENDPOINT_GRID But it's being used often in the code such as below: 'use strict'; var PagingModel = require('dw/web/...
0
votes
1answer
51 views

Checkbox is always unchecked in LWC

I have below HTML code where I click on the header check box and it should check all the check box rows <thead> <tr class="slds-line-height_reset"> <th> ...
0
votes
0answers
38 views

Pass JSON String in Visualforce component

I need to pass a JSON string in my Visualforce component : {'BillingCity':'Dubai'} <apex:page showHeader="false" sidebar="false" standardController="Account" recordSetVar="accounts"> <c:...
0
votes
1answer
40 views

Getting a REGEX too complicated error when trying to programmatically screenshot a page

I have a requirement where I have to take a screenshot of multiple pages and store them in documents on the click of a button. I have everything working perfectly on a windows machine. But when I try ...
3
votes
1answer
136 views

Some users get the error “Unable to set property” when clicking a custom Javascript button

Since a couple of weeks, some of my users have a problem with a custom Javascript button in Classic. They get the error message "Unable to set property 'innerHTML' of undefined or null reference". No ...
1
vote
0answers
150 views

How to fetch input field value in JS in LWC [closed]

in the below html code I am iterating 2 lists linItemData(11 records) and studyData(20 records) <table class="slds-table slds-table_cell-buffer slds-table_bordered"> <thead> ...
0
votes
1answer
20 views

Object Property Visible But Undefined

In an aura component, I'm passing a list of records of a custom object from the server to a helper function. Now as a JS array of objects, I attempt to add a new property to each object and assign ...
0
votes
0answers
57 views

Uncaught TypeError: 'set' on proxy: trap returned falsish for property 'percentage'

I am trying add a value to a property in js in lwc On click of apply button I need to fetch the data from all the input field iterated below as per the size of lineItemData array but when I hit apply ...
0
votes
1answer
63 views

How to use input field value in LWC

I have below table in lwc, size of the lineItem list is 11 records and accordingly it created 11 input fields now whenever I add anything on one column it shows on all 11 but the the requirement is ...