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
27 views

get div Id inside Apex:pageblocktable using Jquery

I am creating a heirarchical structure between account and contact using pageblocktable within another pageblocktable. I have a div tag that is holding the contacts pageblocktable for each account. On ...
1
vote
1answer
43 views

convert this javascript code to work in lightning

The Sales representatives in my company can log into an user profile by clicking on a custom link in SF classic which is an on click java script and when clicked on that link the representative is ...
1
vote
1answer
21 views

Trigger addError('blah') -> Lightning Components JS alert('contense of addError('blah')')

I am sure my Title does not help much, but not sure how to shorten this question concisely. I have a Lightning Component that has the ability to update a case record. I have an APEX Trigger that ...
0
votes
1answer
21 views

How do I replace all non-digit characters in a regex except for the period?

In my VF page I have some Javascript to format passed variables. I have a string eg "Cost is $100.00" from which I need to remove all non-digit characters, EXCEPT the digital period. I want the result ...
0
votes
0answers
10 views

setInterval spikes on Visualforce Page / Works on other HTML Pages

I am trying to use javascript's setInterval() function to create a timer that actions at certain times, however the following Javascript which works outside of Visualforce, jumps from 0 to a random ...
0
votes
0answers
439 views

Javascript alert disappears after few seconds in visualforce page

we have a pop-up in live agent console. Basically we have a visualforce page on top of third-party live agent console. it will pop up when a call comes in. In the last couple of weeks, the pop up ...
1
vote
0answers
15 views

Customise Standard lightning Component from custom lightning component

I have a custom feed filter visualforce page created with the help of this link. And then I added the vf page in lightning component with iframe and in case page layout. After the page is loded main-...
1
vote
2answers
99 views

LWC: detect last element in for:each iteration

I'm trying to output a list of strings separated by commas in LWC, such as: cat, dog, mouse I need to use template for:each and output a list item and a comma, but only if the item is not the last ...
0
votes
1answer
34 views

SetCallBack only firing after user action and not automatically

I am building a community containing lightning components. I have a lightning component controller calling a function in the helper. The helper function calls the apex controller function to retrieve ...
0
votes
0answers
41 views

Marketing Cloud SSJS - does not write to DE

I have a SSJS to be used in rest api calls. It will be an scheduled call thus this is an script activity. The script automation returns a success but I do not see any changes, it should write to DE if ...
0
votes
2answers
39 views

Remove rows from Datatable in lightning controller?

Is it possible to remove rows from custom datatable within JS controller that is without making server call. <th scope="row" class="slds-text-align_left" style="width:3.25rem;"> ...
1
vote
3answers
716 views

how to check lightning component is opened from quick action dialog box

I have a lightning component were it used at two places once at Quick action button in popup and other in record detail page layout. Know i would need to recognise when the component is opened in ...
0
votes
0answers
13 views

ErrorObjectNotFound javascript error on upload csv

I was working on a feature to load records as picklist values on to a custom lookup component from a csv upload. The functionality was working as expected, but I get an error that says "...
1
vote
1answer
33 views

force:createRecord and passing params other than the recordId to the default field values

var objectType = component.get("v.sObjectName"); var createRecordEvent = $A.get("e.force:createRecord"); if(createRecordEvent){ if(recordTypeId){ switch (objectType) { case "...
0
votes
0answers
24 views

Renewal Opportunity Button

Hoping someone may be able to help me here NOT A DEVELOPER! Inherited Org with a button on a Custom Object called Support Contract. When clicked this button creates a New Opportunity with Product ...
0
votes
0answers
15 views

How to create an agenda view on a record page for booking purposes?

I'm trying to create a booking type functionality where users can pick a timeslot for a specific day. Here's the record page: https://imgur.com/a/AQQLOcA Basically, I'm using JavaScript to just ...
2
votes
1answer
46 views

Keydown event throwing TypeError: Illegal invocation

I'm trying to implement a keyboard event to detect if the user has the Caps Lock on is on while typing in an input field, so I have my component like this: <span onkeyup="{!c.keyCheck}"> &...
1
vote
1answer
487 views

Custom, dynamic highlight panel

I am attempting to create a custom highlight panel. What I ultimately need to do is on the focus of a subtab, I need an event to fire and send information to the highlight panel. The highlight panel ...
0
votes
2answers
539 views

Show Loading gif after onchange() in inputField

I have a very simple VF page that calls a method in my controller to populate a selectoptions. The method in my controller calls an external API so it takes a bit of time to populate selectoptions. ...
1
vote
1answer
42 views

Does LWC @wire works with custom classes?

I'm trying to use @wire with a method that returns a list of my custom wrapper class. The list is returned, but the items have no fields. When I'm using @wire with List of SObject, everything is fine.
0
votes
1answer
27 views

What does component.get('v.recordId',value) do?

I am reading a component and I found the following line: component.get('v.recordId',accID); I didn't know there was syntax like this what does it do ? I logged it and confirmed that it works, but I ...
0
votes
0answers
30 views

onchange event not triggered on removal of last character - LWC

I need to display the count/length of string entered in a text box as and when changed(addition/subtraction of new characters) using LWC <template> <lightning-input ...
0
votes
1answer
531 views

Download function not working with IE but works fine with Chrome and Mozilla

In my org we have a Vf page with a download link. Onclick of this link a csv file is downloaded. This is working absolutely fine with Chrome and Firefox, but the file doesn't download with IE. Any ...
10
votes
1answer
609 views

JS Synchronous Calls - Email with Attachment

I'm trying to set up a JS button on a SFDC object record that sends an email to a recipient with a specific attachment from the Notes and Attachment related object. Would I theoretically be able to ...
0
votes
1answer
76 views

How to access record's field values using lightning:recordEditForm?

I have over ridden a standard EDIT button in classic app with a visualforce page and in that visualforce page I am calling a lightning component to update the record and it's child records. I want to ...
0
votes
2answers
572 views

Disabling the custom Button

I created a custom button detail page button and using that in my detail page. That button executes JavaScript code.I want to deactivate that button once it is clicked. Can we deactivate the custom ...
2
votes
1answer
75 views

Firing EventListener inside Controller method

I'm trying to implement something that I would do in plain JavaScript and get it to work in Lightning. I want to detect a keyup action on an input field, so I have my component wrapped within a span ...
0
votes
0answers
63 views

How to retrieve parent record fields from child record in lightning record edit form?

I have this component where I have docman object as a child object to Contact. I need to retrieve contact ID and a few fields of contact in this below lightning:recordeditform. As I need to ...
0
votes
1answer
28 views

How to pass index of row to the JS controller and hide the fields dynamically in dynamic rows in lightning component?

so, I am able to hide/unhide fields based on the pick list selection but the problem is it only works for first row in multiple dynamic rows. Here's the screen-shot, dynamic row picklist selections. ...
2
votes
1answer
49 views

Re-Evaulating Selected-Rows in Lightning-Datatable When Data Changed

I've been stuck on this issue for a few hours now and don't seem to be getting any closer to resolving it. I currently have a Lightning-Datatable with pagination that renders 20 rows at a time. When ...
0
votes
0answers
7 views

unable to fetch value from igGrid

Can anyone please help me in below JS code snippet, which is not rendering value from the record. i could be able to see the value for the first alert, but when it throws error while executing second ...
1
vote
0answers
33 views

XPath in lightning Javascript

I have an XPATh expression which i want to use in my lightning javascript file. I tried several examples but i have been unlucky. Can someone tell me how do i get a reference of the dom using xpath ...
2
votes
1answer
31 views

Detecting Caps Lock not working

I'm trying to detect if a user is typing into an input field when the Caps Lock button is on. I've started with an input wrapped within a span that performs an onkeypress check: <span onkeypress="{...
0
votes
2answers
2k views

Dynamically Add Rows in Lightning

I know this question has been asked before, but I've run across different code that supposedly works, but isn't working for me. The error I keep getting is: "Uncaught Action failed: [...] [...
2
votes
0answers
29 views

Anyone got the Ace editor to work from Visualforce?

I would like to embed the Ace JavaScript editor in a Visualforce page. One problem is that even the minified source trees are quite large so have to be "chopped" down to fit within the 5M static ...
1
vote
1answer
512 views

Add data in apex:pageBlockTable using jquery and get its data and send back to apex class

I've made an apex class which is something like this: public class formBuilderClass { public Map<String,List<String>> objectFieldMap { get { if(...
2
votes
1answer
619 views

liveagent.init callback function

I am trying to setup liveagent but am running into an issue with starting the chat. We have a form that the user enters information about themselves, and then a button to begin the chat. I use the ...
0
votes
1answer
16 views

VFP List Button Object Fields

Currently, converting a Javascript List Button to a List Button that uses a VisualForce Page. The button is on a related list on the Opportunity layout. Is it possible to grab Opportunity fields if ...
6
votes
1answer
89 views

eval() in Lightning Web Components

This code works in JS <script> let object_1 = "value"; window.console.log(eval("object_" + 1)); </script> But I try to do it in LWC and I get the error that the variable is "...
3
votes
0answers
63 views

Using Javascript window.confirm() in Lightning Experience

We are using window.confirm() in the JS parts of Lightning Aura Components and embedded Visualforce pages (iframed). This worked just fine for several years. Yesterday I noticed that in both use ...
4
votes
1answer
430 views

Array.push() won't update Lightning Web Component View [duplicate]

We are migrating over to Lightning Web Components in the last couple of weeks now and we had some struggles with the arrays in Javascript. On a trackable array, when I call push in a wiredMethod, ...
1
vote
2answers
65 views

Trying to trigger an automation from different Business unit using SSJS Activity

I have written the below code and created one test scheduled automation to start the automation. I didn't get any error when i did scheduled/publish the code but my automation is not starting. and i ...
1
vote
1answer
36 views

focus() not working

I am opening a model and trying to set the focus to the model when it opens but focus() isn't working. Here is my component <a id="{!v.job.jobrequisitionId + '-declineLink'}" aria-label="{!$Label....
1
vote
1answer
1k views

How to output time field in lightning component

I have used a time field which I want to show in a lightning component When I fill 8:00 in my field my result is 30600000 in my lightning component. I have searched for a time tag or formatting but ...
0
votes
2answers
57 views

How to get all records from Report using JSforce NodeJS

I am trying to get all records from a specific Report. I am using NodeJS and the library JSforce. I have tried using the following code: var report = conn.analytics.report(reportId); report.execute({...
1
vote
0answers
28 views

Orderitems Javascript Button replacement for Lightning

Currently I have the following as a javascript list button that allows the user to selected records: {!REQUIRESCRIPT('/soap/ajax/29.0/connection.js')} var selectedRecords = {!GETRECORDIDS( $...
1
vote
2answers
416 views

Regex on lightning:datatable

I'm using lightning:datatable to display the Account object in a table. I've also added a regex that lets users search for any field in any column. What I wish to do is, if there are no matches, ...
0
votes
1answer
17 views

Fetching latitude longitude datat from image on IOS in SF1 App

I need to to fetch the Latitude and Longitude of Image captured or uploaded using SF 1 App.I am using EXIF to fetch the same in javascript(helper) While it is working on android , same does not work ...
1
vote
1answer
699 views

How to get picklist values based on record type in javascript VF page

I am using Javascript to get picklist values(dependent or normal picklist).Its working fine. But the problem is i am getting all the Picklist values for that object. I have to get picklist values ...
0
votes
2answers
1k views

Action Method and JavaScript Function

Can anyone tell me how to execute the action mthod as first and javascript function as second based on the result of action method. My problem is: I have command button which has action method and js ...