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
1answer
43 views

Lightning Component integer attribute not matching javascript integer

I have an attribute of type integer. <aura:attribute name="selectedRowNum" type="integer" /> I also have an iteration component in which I get the index of the current object that is being ...
-2
votes
1answer
56 views

How to insert data from modal and close it

I'm writing a lightning component that does the below. Clicking a button will pop a new form(Modal). I will fill the form and hit the save button in that Modal. The data gets inserted into the ...
0
votes
1answer
40 views

Promise JS to handle Future Callout from Lightning Component

I am using Promise JS in my lightning component to make a server call. The apex class makes a callout to a external endpoint and returns the response to the component. This is working fine. After ...
1
vote
1answer
71 views

javaScript:Void(0) refreshes the page when dynalimically creating component using $A.createComponents

I'm trying to make a link dynamically using $A.createComponents but it tends to refresh the page even if I use javascript:void(0) Previously this was working fine but in the latest release this is ...
1
vote
2answers
35 views

Embedded Visualforce Page to Update Custom Field

I am using an embedded Visualforce page as a custom button to update a custom field on my Opportunity record. The page saves fine and shows on my page layout, but when I click it, nothing happens. ...
1
vote
1answer
48 views

Embedded Visualforce Button to Update Field

I am trying to have an embedded VF page show as a button on my Opportunity record that will update a custom field. The page loads, but when I click the button, nothing happens. Does anyone see what ...
1
vote
0answers
64 views

Unable to get clientHeight/clientWidth on an html element in lightning

I have a very simple thing here: <div class="slds-truncate"> <a id="popoverToggle" href="javascript:void(0);" data-value="{!v.recordId}" onclick="{!c.togglePopover}" style="position: ...
1
vote
1answer
69 views

Multiple calls to lightning:quickActionAPI getAvailableActionFields() fails

I get an error when doing multiple calls to getAvailableActionFields in a Promise.all(). The markup: <aura:component implements="force:hasRecordId"> <lightning:quickActionAPI aura:id="...
0
votes
0answers
19 views

Is it possible Configurable Header Markup in lightning Community?

Currently, we have something like this, Now, Requirement is to get the url from some configurable metadata. Like Custom Metadata, Custom Label? This is important because that is provided by 3rd ...
-1
votes
0answers
36 views

client dom open redirect in Visualforce Page (SCAVA Security Issue)

We are facing scava security issue for the below lines in visulforce page. //var query = '{!JSENCODE($CurrentPage.parameters.strURLRedirect)}'; var query = window.location.search.slice(1);// SCAVA ...
0
votes
1answer
31 views

loop through components looking for data in it

im building a list that people select only a single item which works in a limited capacity but reloading or re-selecting isnt very user friendly. the basic concept is a controller retrieves selections,...
0
votes
0answers
19 views

External Javascript Library Loading Error [duplicate]

I have a lightning component that I want to use html2pdf JS library in and Im getting the following error when the component loads. This seems like a Locker Service conflict, does anyone know how I ...
0
votes
1answer
82 views

Cannot Read Property 'getList' of Null Exception

I have a component which iterates over a list of records and in turn calls a child component for each record returned. This works fine. I also have a lightning:slider in a seperate component which ...
0
votes
0answers
49 views

XMLHttpRequest Onload not working in Edge browser

I'm running into an issue where Microsoft Edge browser isn't able to execute an onload in my Lightning component Helper.js. But it does run in Chrome, Firefox, and Safari. I'm creating an ...
0
votes
1answer
36 views

Event not being handled in lightning component

Hello I am trying to handle an event in my lightning component between 2 items being dragged and dropped onto another. My event seems to be firing, however it is not being handled as the function ...
-1
votes
0answers
33 views

Close Component

While adding a close button in a component that is an object account action, the button onclick returns an error in the handleclick function. I would appreciate some help. This is code: markup: <...
0
votes
1answer
27 views

Insert value in apex time field

I want to insert the record in custom field whose data type is time. Example: obj o = new ojb(); o.StartTime__c = 10:20:00.000zCET; but i am getting the error. Unexpected token '='. I have ...
0
votes
0answers
283 views

Uncaught Error: reCAPTCHA placeholder element must be an element or id

I am trying to place multiple Captcha in single vf page. this are written in visualforce component. while loading i am able to see only one Captcha. when i have done inspect elements i got this error:...
0
votes
2answers
388 views

Cannot read property 'setParams' of null

my set params is null for some reason. But the variables i'm passing in do have values. I have a console.log before I set params to check before the parameters are set to their values. Can anyone ...
3
votes
2answers
70 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 ...
0
votes
1answer
132 views

getParam Not Working on Simple Application Event

I have a button which when pressed causes an application event to fire. Before it does this it sets a string value using setParam. The event is fired and handled successfully. However, when I try to ...
0
votes
0answers
31 views

Passing a validation function in JavaScript to apex

I have a function written in javascript to validate a field and i need to transform that function to a before insert trigger. I'm a bit of lost in how to do this. This is part of my function: ...
6
votes
1answer
72 views

Help Interpret Peculiar Way of Handling SUCCESS and ERROR in Lightning Callback

I didn't write but rather I'm reviewing the following Lightning JS function: InitializeComponent : function (component) { var recId = component.get("v.recordId"); var action = ...
1
vote
2answers
31 views

Help Interpret Advanced Array Work in Lightning JS

I didn't write but rather I'm reviewing the following Lightning JS function: InitializeComponent : function (component) { var recId = component.get("v.recordId"); var action = ...
-2
votes
1answer
112 views

Problem with the onclick javascript for this button or link was encountered unexpected token [closed]

I am getting an "invalid or unexpected token" error in the javascript code below. This code is part of a Detail page button. {!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")} {!REQUIRESCRIPT("/soap/...
2
votes
1answer
103 views

Lightning action call inside setTimeout returns result only when window (tab) loses focus

I have a Lightning action call inside a recursive setTimeout call. I call the action immediately and then every 3 seconds until the result it not null. I see my console.log('tick'); immediately. But ...
0
votes
1answer
27 views

How do I handle client side error handling?

I am creating a lightning component that will have a button that, when pressed, will update the record being viewed and send an email alert. I have managed to get the functionality working as it ...
1
vote
2answers
20 views

Static resource img is not working in VF page

I want to change the background img of one of the div I have tried multiple ways but not working, below are the code. Please help/correct me. <script> $(document).ready(function(){ ...
0
votes
1answer
23 views

Invalid Page Redirection error for html input type file saving as attachment

I have below page snippet that throws error as in header. Apex Page Snippet:   Save <script> var blobfile; ...
0
votes
1answer
14 views

how to make Classic Javascript Pop up box with drop down list?

Hi I've created a custom button that fills in an email template. I'm trying to add an drop down list so the user can select the template they want. Right now it uses a prompt pop up window, where as ...
-1
votes
1answer
133 views

JavaScript Make the second dropdown value equal the hidden dropdown value when selected [closed]

I have a repeated dropdown hidden list (tfa_1043) in FormAssembly and when a value is changed I need the displayed dropdown list (tfa_4) option value selection to equal tfa_1043 selection function ...
2
votes
2answers
74 views

Hiding JS console logs with a Lightning Component

I need to hide all javascript console logs in production environment.There is a component that i use in every lightning component(i.e Base).What is the most efficient way to hide the logs.I am ...
0
votes
1answer
31 views

FormAssembly Using JavaScript to fill in fields based on an Event Select change

can't seem to get the select change to update the location field based on the repeater location section. No errors it simply does not change the location(tfa_4) drop-down to equal the repeater ...
0
votes
0answers
33 views

cmp.find(…).getElement is not a function Failing descriptor: {c:autoComplete} [duplicate]

Here In the Lightning I'm trying for autocompletion in a text field I'm getting the below error This page has an error. You might just need to refresh it. afterRender threw an error in 'c:...
2
votes
1answer
46 views

lightning:input methods - which are available? [closed]

Mistake in Lightning Component docs or my misunderstanding? From the Lightning Component Reference at the very bottom of the "Documentation" tab it reads, This component supports the following ...
0
votes
0answers
97 views

Lightning Alternative of Window.Open() method and Window.Close() method

When you run a Lightning experience readiness report, you will get a note that windows function will not work in Lightning. function Close1(){ window.close(); } I tried with apex:...
0
votes
1answer
32 views

user profile in javascript without apex

How can we get user profile in lightning javascript component without writing Apex class? Please let me know
0
votes
1answer
43 views

OpenCTI - retrieve data from call object

We're using OpenCTI for our call center connector, and we're trying to call out to a web service from a button click on a custom object layout, passing arguments including the call UUID passed in the ...
2
votes
1answer
201 views

Efficient way to check if Object contain any field with null/empty value

I think we all have faced this check, do any field value is blank or not? I did it like this(in lightning) var commonObj = component.get('v.commonObj'); if( $A.util.isEmpty(commonObj.FirstName) ...
0
votes
2answers
35 views

Custom button without javascript code

I have a requirement where I need to pass record Id to apex class on click of a custom button(which is placed on the standard page). In order to pass record id, I need to write javascript code, but ...
0
votes
1answer
85 views

How to Access Wrapper class variable in javascript?

Trying to access the wrapper class variable in javascript, but it's not serialized in apex controller. trying to get the value in for loop - mainly for validation purpose. function ...
0
votes
0answers
39 views

Passing data between lightning component in a Flow?

I am trying to wrap a few lightning components into a Flow - the components as is works just fine, data is passed correctly. However, if I try to add the components "step-wise" into a flow after using ...
0
votes
1answer
54 views

refresh parent visualforce page from child visualforce page

I have a piece of code which opens a popup, I enter some values and the field values need to be updated back to the parent page(visualforce page). Also I need to close the child visualforce page when ...
0
votes
1answer
107 views

setting value on a div not working

I cant set value on div during aura iteration, the reason why I need to set it on a div cause the div is writable contentEditable = true;I want to display value there so it can be edit it. <aura:...
1
vote
1answer
40 views

How to consume window.parent.postMessage from a third party application in SFDC Canvas?

We are implementing SFDC and trying to integrate with a third party (different team within same organization) application using Canvas approach. This third party application is being currently used as ...
1
vote
2answers
420 views

Lightning Component: How do I pass a list from Apex to a JavaScript controller and assign record fields to variables?

Hello I am creating a lightning component. I have a list of accounts obtained by a query in an apex class. I want to send this list to an array in a javascript controller that will let me assign the ...
0
votes
1answer
21 views

Is it possible to set up devTools workspace in chrome with Salesforce/lightning metadata?

I'm curently working on some javascript in lightning and it would be so much faster if I could just setup a workspace in chrome devtools so the changes are reflected in the page immediately. Is this ...
0
votes
0answers
21 views

Make Form Unique id

want to generate unique Id for Every form pages: <div class="forms-wrapper"> <form class="offer-builder-form" id="formdata"> <div class="offer-builder-...
0
votes
1answer
21 views

Can we access Apex Controller class from a separate .js file?

I have a separate .js file and I want to access controller properties and functions using that file but as far as I know we must have a .vfp page and a controller attribute is given to apex:page, but ...
1
vote
0answers
19 views

Customizing Marketing Cloud Homepage UI to have message box pop-up when a user logs in - possible?

Is it possible to display a pop-up window or a message box, containing text and buttons to agree and disagree to the message, when a user signs into an account and loads the Marketing Cloud homepage? ...