We’re rewarding the question askers & reputations are being recalculated! Read more.

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
3
votes
2answers
45 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
28 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
27 views

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

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
355 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 ...
4
votes
1answer
45 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
0answers
33 views

Include the Country Code in Data Extension [on hold]

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 ...
2
votes
1answer
978 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
votes
0answers
30 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
52 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
27 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
0answers
28 views

Cannot get ag-grid working in Lightning Web Compnent [on hold]

I am trying to get ag-grid working in LWC. I have gotten other 3rd party libraries such as Full Calendar working. I created static-resources as described in docs and following samples from lwc-...
1
vote
2answers
527 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
38 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
430 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
432 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
36 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
124 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
55 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
348 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
13 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
120 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
296 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
40 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
35 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
817 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
398 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
78 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
785 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 ...
1
vote
2answers
3k views

Customised confirmation dialog in a Lightning component

Hi I want to show a confirm dialog as shown can the do the same using Lightning CSS. I know we can use onclick="return confirm('test');" but look and feel of the same is different. How should I ...
0
votes
1answer
438 views

Custom Button JavaScript to select a check box error

I am currently working on a button on the lead object to automatically select a check box field on the lead object when pushed. The field is called "advocate_record_created__C". When trying to execute ...
0
votes
1answer
19 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
40 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
50 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 ...
0
votes
0answers
61 views

Using RxJs with LWC in Salesforce

I want to use RxJs in my LWC. I was successfully able to import RxJs version 5. However, how can I use it with LoadScript. This is my code, it is giving me the following error "of is not a function at ...
0
votes
1answer
41 views

Wired Apex for LWC

I am hoping a better JS developer can explain to me why one of these methods fails and the other works. I have some wired Apex to get data into an LWC. If I used a tracked property and 'this....
1
vote
2answers
57 views

How to create a reusable picklist component

I have created a lightning web component which is a pick-list. My intention is to pass objectApiName and fieldApiName as parameters and then render UI accordingly. So that I can reuse this component ...
3
votes
2answers
353 views

Component.set is slow with a large array of objects

I am developing a lightning component. In this component there is an attribute called allItems that contains an array of objects. Currently tested holding up to 600 objects. However when I call a ...
1
vote
1answer
24 views

How to edit cell value of lightning data table programtically

I have a lightning data table with a inline editable field. It working perfect as expected when I do manual edit and save. What I need in addition to the existing behaviour is, I need to edit the ...
3
votes
1answer
68 views

Equivalent of !$A.util.isEmpty() in LWC

I have been using !$A.util.isEmpty(var) to check if value in empty/null/undefined in aura but this is not supported in LWC. What will be equivalent of this expression in LWC. I don't want to write ...
2
votes
1answer
420 views

JavaScript Error when typing in lookup field

I am receiving this javascript error in an up-to-date version of Google Chrome (Version 45.0.2454.101 m): error: {faultcode:'soapenv:Client', faultstring:'Attribute "xmlns" bound to ...
0
votes
1answer
22 views

ParseJSON Error for HTTPPost - SSJS Unable to retrieve security descriptor

In my marketing cloud, landing page. Getting the error "System.InvalidOperationException: Unable to retrieve security descriptor for this frame" while trying to Parse the JSON response in a HTTP Post ...
0
votes
0answers
19 views

Quick Action with Lightning Component appears in the Feeds

I am trying to reproduce the button we have in the SF Classic in to Lightning. The button (Pass to Customer Service) assigns the cases to the Owner (Customer Services whose id is(eg: ...
0
votes
1answer
20 views

Convert custom button in to Lightning component

We have a Custom Javascript button on the case object which looks like below {!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} var caseObj = new sforce.SObject("Case"); caseObj.Id = '{!Case....
3
votes
1answer
83 views

Normalizing Boolean values in LWC

Looking at LWC e-bikes sample gallery, I found these comments in code regaring normalizing values. Can someone refer to what they have meant or how to do this normalization using best practices? ...
1
vote
1answer
696 views

Pass an Array variable between javascript and apex

I have a little problem but I'm not able to find a solution.I'm trying to pass an array variable "d" from javascript to List variable "values" in the apex controller. Here my code: javascript: ...
0
votes
1answer
414 views

How to prevent outputpanel from rerendering when javascript is fired

I have a lookup field that inserts a row of fields onto my page. I have an outputpanel that surrounds the html which needs to be rerendered. The problem is, inside that outputpanel I have a few ...
2
votes
1answer
54 views

Way to add Icons/Image in Lightning Combo-box in LWC? [closed]

I want to create UI in LWC, as per images shown below : Those icons have to be dynamic (depending upon certain conditions those will change). I created lightning combo-box, but I am not able to icons ...