Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey 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.

1
vote
0answers
68 views

Lightning button attribute “Disabled” in “aura:iteration tag”

I'm trying to enable a lightning:button if a lightning:inputField changes. This is the aura:component: <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:...
1
vote
1answer
29 views

JQuery and Disabled Attributes

I am unable to get this bit of JS to work. I have a few questions: Am I not allowed to put the disabled attribute on the apex:inputField? Am I importing the JS url incorrectly? Is it possible that ...
0
votes
1answer
123 views

Simple Popover Example Causing: “Cannot read property 'na' of undefined”

I'm trying to get the popover example from the Salesforce documentation working and it's giving me an interupt error with "Cannot read property 'na' of undefined" message. All I have done is copy ...
0
votes
1answer
16 views

Get the values from the input fields

I'm trying to get the values for the input field text and checkboxes and so far I can only get the country variable in a way I believe is not correct. The value I get for nif is undefined and the ...
0
votes
1answer
74 views

How to display/hide fields in Lightning component using Javascript

I have a form in lightning component. Here are the two fields on the form <lightning:select aura:id="whoRequestedTheEvent" required="true" label="Is this event being requested by XYZ"> ...
1
vote
1answer
27 views

Dynamic query object from lighting component

Is there anywhere to query data and depend on objects that lighting component display? Let me explain my requirement. there are 2 objects that was using same my lighting component that i want to ...
1
vote
1answer
67 views

Only 1 of 3 JavaScript files load when using <ltng:require> and afterScriptsLoaded event not firing

Background I am trying to use the PageDown JavaScript library: Markdown.Converter.js - (click to view source) Markdown.Editor.js - (click to view source) Markdown.Sanitizer.js - (click to view ...
1
vote
1answer
26 views

How to create lead via webhook javascript firebase

I've got some fulfillment code in dialogflow firebase where I ask for some user info, then I want to use that info to create a salesforce lead. This code is just grabbing the params from the agent: ...
1
vote
1answer
57 views

Second <aura:iteration> not working with object/array datasource

I have a Lightning component with two <aura:iteration> <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> <aura:attribute name="invoices" type="Object" /> <aura:...
0
votes
1answer
53 views

Pass method from controller to javascript

Could you please to help this? I'm very new with javascript.I have tried many way but it doesn't work. I have problem with javascript function I have tried to call method from controller but it doesn'...
0
votes
0answers
33 views

Unknown method 'continuationCallback? when invoked from ActionFunction

VF Page code: <script> $(document).ready(function() { //showing spinner here callAsyncProcess(); function fireOnComplete(){ //stopping spinner here } }); </...
-1
votes
0answers
21 views

reRender on actionFunction is not working

I have a command button which calls my JS method and then calls my actionfunction like the example below: <apex:commandButton onclick="removeCheckbox(this);" value="Save"/>&nbsp;&nbsp; &...
0
votes
1answer
89 views

Convert JavaScript button for lightning!

I have a JavaScript button which works fine in classic but doesn't show up in lightning, my guess that JavaScript buttons are not supported in lightning, I couldn't convert it using the converter ...
0
votes
1answer
25 views

Deselect Select All checkbox after DML from apex class

I have below code snippet where I have perfectly working select all checkbox. My requirement is to deselect the checkbox after I have successfully updated relevant records in apex class. Page <...
3
votes
0answers
39 views

getReference databinding for maps

seems I have found a bug which prevents data binding in case of arrayed Maps. Maybe you can help me how to get around this. I have a list of Custom Objects, I iterate over. Each of the components, I ...
-1
votes
1answer
133 views

How to drag and drop the records using lightning component?

I need to drag and drop the records in contact object. for example i am having 10 records in contact object.when i drag the 6th record to 4th record, need to replace the 6th record to 4th and 4th ...
0
votes
1answer
15 views

Error in main.js and main.js is generated from the wrong Visualforce page

I have a Visualforce page which shows an error: Uncaught TypeError: Cannot set property 'value' of null at submitToSalesforce (main.js:55) But when I update the visualforce page it does not update ...
4
votes
1answer
52 views

Call an apex method when leaving a Visualforce page

I have done some looking around and I cannot seem to find a current solution to my issue. I would like to call an apex method to remove records when a user leaves a visualforce page. I've gone down ...
0
votes
0answers
21 views

Can I assign fields to a record in a recordForm component using JavaScript? [duplicate]

Is it possible to assign a field to a record loaded with the component lightning:recordForm? Like: component.find('myform').set('v.record.Field__c', 'We were hereeee!')
4
votes
1answer
161 views

Stripe integration for Salesforce in lightning components

We are trying to implement Stripe integration with Salesforce by using Lightning Components for payments. Stripe use an API for securely obtain the users card information. This API is for the client,...
0
votes
2answers
53 views

Detecting UI Theme from Javascript Static Resource

is there a way to detect if I stay in Salesforce Classic or Salesforce Lightning context from javascript as static resource? I need this because before to detect the user theme I used if(sforce &...
0
votes
1answer
27 views

How to make jQuery slideToggle() for the list?

I try to make a list of panels with same toggle-effect. But I get just first working element. How can I make it for the list? <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery....
1
vote
1answer
28 views

Multi thread in lightning component script

im looking for some method to divide thread in my lightning component JS. As far as I know is JS running on single thread. but web.Worker function can be alternative. i tried to use web.worker .. ...
1
vote
1answer
35 views

Element top offset based on viewport, but left offset based on parent when trying to position (lightning component)

I am quite confused by this behavior... I have a component for a popover: <div aura:id="popoverWrapper" style="{!'position: fixed; z-index: 10001; top: ' + v.offsetTop + 'px; left: ' + v....
-1
votes
0answers
16 views

Adding text to Chatter Email Region using JS

Hi I am a newbie at sales force and developin a custom app. In my use case I want to send text to chatter - email section on click of a button. I tried using : document.getElementById("...
0
votes
1answer
23 views

How to send an arrayList from Apex to Javascript and then to HTML?

I'm new in JS and can't understand, what is wrong here (this is my test value, but then I want to send an arraylist's elements): Apex: public String test{get;set;} public String myApexMethod(){ ...
0
votes
1answer
44 views

How to call force:navigateToComponent from Salesforce Lightning Custom Object List View

How could I call force:navigateToComponent from a Salesforce Lightning Custom Object List View? If I try and add a Custom Button or Link which has a Behavior of Execute JavaScript it displays a ...
8
votes
3answers
227 views

Lightning Framework vs Standard Client Side Frameworks (i.e. React) // Which to chose when, and why?

Disclaimer Keep it objective! This one can get a little opinionated, please try to keep your answer specific to the facts a developer should be considering when choosing between two viable options ...
3
votes
1answer
54 views

Lightning component: error when loading a third party js library (frappe.io)

I was hoping to be able to use this JS library (https://frappe.io/gantt) inside a lightning component, initially after loading the library I was getting the error .... $controller$doGantt [Gantt is ...
0
votes
1answer
78 views

Not working: Javascript to select all checkboxes from Header checkbox in Visualforce page

I am displaying a table with checkboxes using wrapper class. Now I want to add a checkbox to the header, when selected it should select all row-checkboxes and when deselected it should deselect all ...
2
votes
2answers
39 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 ...
0
votes
1answer
57 views

helper function undefined in helper after callback

In my helper function, I have two functions that are called: first one validates data that's in another component using an API,shipmentInfo.handleIsValid. After it returns the desired result, I get ...
0
votes
1answer
19 views

Need to get the error message from the Controller to Display reply OK and there is an error

this is now working fine but the problem in this it not recognizing the errorMessage attribute from the controller. I need the confirmation page - working now if the user press OK and there is a ...
0
votes
1answer
30 views

Can we self-host pd.js?

We are adding the Pardot tracking script to some of our pages. Looking at the JS, all it does is set a couple of variables and load a further JS file (https://pi.pardot.com/pd.js). Is there any reason ...
0
votes
1answer
109 views

Add 30 days to a date in lightning helper js for localizationService fucntion

I want to add 30 days to the date which I am initializing in the helper js. I have tried in the below way. getDate : function(component,event){ component.set("v.showSpinner",true); var selected =...
0
votes
1answer
28 views

How do I replace a Classic custom javascript button with something that works in Classic and Lightning?

I have the following custom button on my Classic Order object page layout, which is an 'Execute Javascript' one and the OnClick Javascript is as follows: {!REQUIRESCRIPT("/soap/ajax/25.0/connection....
0
votes
0answers
30 views

Getting Javascript Error [duplicate]

I am getting a Javascript error from the code below, however, I am only getting it for some records while others process as expected. There does not seem to be any rhyme or reason why. Does anyone ...
-1
votes
1answer
32 views

How to call action method from Javacript inside the Visuaforce page

this working fine but I want to add confirmation window for OK or Cancel. OK means call the NewCase action from script and cancel mean close the confirmation page. <apex:page standardController="...
1
vote
1answer
26 views

Display Conditional Alert with Javascript

I have a custom button that displays an alert message when some fields on my object are missing. I would like to now also display the fields that are missing as part of that alert. I tried the code ...
0
votes
0answers
47 views

How do I hide my Lightning Out app access token?

I am exposing a Lighting Out app via a Node.js application running on Heroku. To do so, I need to pass an access token into the $Lighting.use() method. My site visitors are not logging in themselves, ...
0
votes
1answer
22 views

Hide a commandLink onClick

I'm trying to hide a commandLink type"button" onClick, i will give you the code below. <script type='text/javascript'> applyCSS: function(cmp, event) { var cmpTarget = cmp.find('save'); ...
4
votes
2answers
349 views

How can I stop JavaScript remoting reloading page

I'm trying to see what is my RemoteAction result however the page reloads before it happens. How can I stop this? VF Page: <button class="btn-enter-panel" onclick="getRemoteName()">enter <...
-1
votes
0answers
33 views

Windows function isn't support in lightning!

I have a window function which it says in the readiness report that it is not supported in lightning however when I try and run the visual force page it works fine, what the hell is this! This is a ...
0
votes
2answers
18 views

Take ownership and open case link on list view

I've created a button called Assign to Me and have gotten it to correctly move a case from a queue to the current user and successfully change status to "Working". I'm struggling to get it to open up ...
0
votes
2answers
48 views

Disabling/Enabling checkbox should disable Input field

I have a panel that display a text box and a check box. AIM1: I want to grayed out input field if check box is selected. And when page is loaded both should be open to use but once selected ...
0
votes
1answer
45 views

How to replace 'window.location.protocol' and 'window.location.hostname' in VF which won't work in Lightning?

I am currently trying to migration my company's Salesforce from Classic to Lightning Experience. However, the readiness report VF says the following: JavaScript included in this page uses window. ...
0
votes
0answers
33 views

Get Id of lookup field with force:recordData? [duplicate]

Does someone know how to pass a lookup field ID to a controller with force:recordData? I got a component on the Opportunity layout, and I'm trying to pass the Account ID to the controller but it's ...
0
votes
1answer
20 views

Visualforce Button with Javascript Not Populating Picklist Field

I have a custom VF page embedded on my Opportunity object. The button populates a custom picklist field with one of the picklist values through a custom label. However, when I have the "Restrict ...
0
votes
1answer
23 views

visualforce list of available javascript libraries? [closed]

This is me frustrated with getting wrong search results... I'm looking for any salesforce based javascript files or libraries available for use in visualforce pages. I've come across a few in the ...
0
votes
1answer
27 views

Passing a return value from apex class to javascript button

I am creating a JavaScript button that calls an apex class that returns a message string. I would like to show that string in a alert box when I press the button. Is there a way to do that? This is ...