Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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
16 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 ...
0
votes
1answer
220 views

Hide div from page layout after print button click

In my lightning component, I have a div with aura:id = "hidefromPDF". On Print button click I want to hide the div from page print. I tried the following code on button click { var hidefromPDF = ...
-8
votes
3answers
67 views

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

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
30 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
33 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
31 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
24 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
1answer
3k views

What's the official term for $A in Lightning Components?

I understand that this variable can be used to access component-level information, but I was wondering what the official term for it is.
3
votes
2answers
34 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:...
1
vote
1answer
424 views

Using Custom Compact layout on Visualforce Page

I have a visual force page displaying lots of information in a report of sorts. To enchance the user experience I have added some code to load the standard compact layout for records to provide some ...
2
votes
1answer
1k views

How to use custom LWC lightning component in lightning-datatable

If we want to have custom lightning component in LWC lightning-datatable, for example Upload file for each of the records, how can we do that?
1
vote
0answers
30 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....
2
votes
0answers
42 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 ...
0
votes
1answer
447 views

How to display Public groups in drop down list in visualforce page?

How to display Public groups in drop down list and in this list select one public group,then search button clicks need to display the users in particular public group? anybody help me......
2
votes
1answer
776 views

getting the query result in json format when working with sforce.connection.query

I have this javascript code in a VF page where I'm trying to fetch records from the DB. I'm getting back an xml format but I need it as a json format. Is there a way to get the result records in json ...
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
1answer
40 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:...
0
votes
1answer
36 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?
0
votes
0answers
14 views

Embedding an Eventbrite Event on Community pages via a custom component or CMS connect [closed]

I am building out an event page on a salesforce community. The events are created on Eventbrite and we want to embed each event individually on the Events community page. I want to create a component ...
2
votes
2answers
63 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-...
5
votes
1answer
71 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 ...
0
votes
1answer
25 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
119 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
47 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 ...
-1
votes
0answers
30 views

How to go about creating a Repeating Dropdown Picklist? [closed]

So I've been tackling this problem where I need to create a dropdown picklist that once selected you click an add button and it renders a new dropdown picklist without the previous selected value ...
0
votes
1answer
359 views

Is it possible to use Javascript in an Apex class?

I am trying to use an inbound email handler to extract a PDF attachment, and then parse out all of the PDF text and save it on a field. The way I am currently doing this is by using a 3rd party ...
0
votes
0answers
36 views

Include the Country Code in Data Extension [closed]

Is there a way to include the Country Code in a field inside Data Extension? I have a field with records that come without this and thinking if have possibility to include this. To be more clear: i ...
-1
votes
0answers
32 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 "> </...
0
votes
1answer
58 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
0answers
31 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)...
1
vote
2answers
533 views

Web to Lead, Date showing in Debug page, but not in the Lead

My contact for is using 2 date pickets, Check-in/Check-out dates. When I fill out the form the dates show fine in the debug page. I receive and email with a link to view the lead and the dates are ...
0
votes
1answer
43 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 ...
1
vote
1answer
432 views

List View Multiple Case Owner Update

I have used the below piece of code to select multiple cases from list view and update case owner. But it does not update the owner when I am selecting multiple cases while it works when I select only ...
1
vote
3answers
436 views

Document.getElementId() not working for some div's in Salesforce Summer'16 release

Since Summer'16 release, I have been getting many issues in Lightning components, resolving them by moving all my JQuery to Vanilla JavaScript. Currently, I am getting an error in Vanilla JS while ...
2
votes
0answers
39 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 ...
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> ...
3
votes
0answers
130 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 ...
2
votes
1answer
68 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 ...
0
votes
1answer
350 views

Javascript in Web-to-Case form

I want to include javascript in my web-to-case from. My sole purpose of doing so is to Query from Salesforce Database in that form. How can I achieve this functionality. Can I use some controller as ...
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 ...
0
votes
0answers
14 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/...
1
vote
1answer
121 views

Javascript not calling apex function

I have an actionfunction called 'afterValidation' defined; <apex:actionFunction name="afterValidation" action="{!prohibitedCountryCheck}" /> I am calling this function on 'Next' button; <...
2
votes
2answers
306 views

Web-to-lead form dynamic return URL javascript

I have a web to lead salesforce form, and I want to have a dynamic thank you page link based on the answers I get in the form. I was trying to do it like so by setting the retUrl var in the ...
6
votes
4answers
15k views

How can I quickly get today's date in a Lightning Component? (for use in an attribute)

In Visualforce, we could merge {!TODAY()} directly in the markup. What is the equivalent in a Lightning Component?
0
votes
1answer
42 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:...
1
vote
0answers
837 views

Re-render jQuerys FullCalendar?

I'm using FullCalendar on a Custom Object that shows each record in a calendar and I'm not entirely sure how I can make the calendar re-render depending on the ID I'm passing it. If I select a ...
0
votes
1answer
400 views

Javascript in place of apex:page action - JS remoting

I want to know if I can use javascript in place of apex:page action. I am implementing js remoting in my vf page. I am going to add @remoteaction before my pagereference method in controller. I also ...
1
vote
0answers
103 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
2answers
793 views

Refresh the page twice in Salesforce with Javascript

<script> window.location.reload(); </script> The above code makes the Salesforce page to keep in the reload state when I add this visualforce page as a page layout. I would like to ...