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

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 ...

0
votes
1answer
11 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
13 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
0answers
17 views

Javascript to get Asset

I'm trying to retrieve an asset from MC but I'm finding a CORS limitation. I'm using the following code: function getAsset(token, aid){ var data = null; var xhr = new XMLHttpRequest(); xhr....
0
votes
0answers
6 views

Upload File in flow embed on VF [on hold]

I have a Flow that will upload a file then the flow was run in lightning and I embed it on Vf. When I test to upload a file and it doesn't work and there is no popup modal.
0
votes
1answer
18 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
21 views

visualforce list of available javascript libraries? [on hold]

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
21 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 ...
1
vote
1answer
33 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
33 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
24 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
18 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
31 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
22 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
18 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: ...
0
votes
0answers
17 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
15 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 ...
0
votes
0answers
16 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
28 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
13 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
28 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
15 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
29 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 ...
0
votes
0answers
22 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
24 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
63 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
51 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 ...
1
vote
1answer
28 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
35 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
24 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
60 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
29 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 = ...
-1
votes
0answers
37 views

I m not getting the value in clipboard in visualforce page

<apex:page title="Clipboard Test" > <apex:messages /> <script language="JavaScript"> function ClipBoard(copytextid, holdtextid){ copyToClipboard(copytextid); ...
-2
votes
1answer
33 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
55 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
0answers
28 views

Get an Image from a Rich Text Area Field (rtaimage)

I am facing some problem with retrieving the images from Salesforce fields. I am trying to follow this link, but I am not able to get the binary form of the image. Following is how my data looks: { ...
0
votes
1answer
13 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
17 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
18 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
11 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
90 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
67 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
18 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
25 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
35 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
13 views

Display and Select multiple Related records and send selected records through Email to a contact

I have Account object and custom object System__c I want a custom button on account and when i click on it,pop up will come and it should display all active systems with select checkbox. once i select ...
0
votes
0answers
17 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
19 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
24 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 ...
0
votes
0answers
24 views

Front-end real time changes update/synchronization, simple alternative?

Is there a SalesForce plugin or typical implementation of live-update/synchronization tools (as LiveReload or BrowserSync) that allows Front End work process to be speed up, skipping the slow building ...
2
votes
1answer
39 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) ...