Stack Exchange Network

Stack Exchange network consists of 175 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

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.

0
votes
0answers
10 views

Closing a vf page properly

I have a modal that uses an iframe which leads to a vf page. There is a cancel button that I created whose functionality is to close the page. I have tried window.top.close. Any other reccommendations ...
0
votes
0answers
14 views

Stop 3rd Party Integration from Changing Record Ownership

We are using a 3rd party app to have incoming emails send to SF under our custom Messages Object. However, the app also changes the ownership of the record to the themselves when a user clicks to view ...
5
votes
1answer
39 views

Any ways to extend a component's template in LWC?

In Aura there was a way to extend component and it's template. Extending component's template would go into {!v.body} slot from the parent component. In LWC we can nicely extend components code by ...
0
votes
0answers
8 views

Redirect in Salesforce1

I would like, after the click of a button on salesforce1, the visualforce page to go to the details page of the object. Example: I have the following visualforce page: After click on "Saver" button ...
2
votes
1answer
29 views

Getting error function not defined while it's there

I need to call the jsPdf function, however in the console I am getting genPdf is not defined. Here is my code-- <apex:page controller="GenerateQuoteController" standardStylesheets="false" ...
0
votes
0answers
10 views

Javascript message disappearing due to mitel phone app loading in side bar

I'm trying to show a pop up message when a field equals a value. I used a javascript alert for this, but when the page loads the message displays for a few seconds and disappears. The only way I've ...
0
votes
0answers
21 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
38 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
20 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
0answers
20 views

How can I overcome a “session is not valid for use with the API” error when accessing AJAX Toolkit as a Community user?

I'm attempting to use the AJAX Toolkit to access the current Account ID of the logged-in user from within a community site. (The particular community is managed by Nimble AMS, and is referred to as "...
-1
votes
0answers
16 views

lightning custom search functionality [on hold]

I have to develop a custom search component in lightning. It will search a custom object and result will be dynamically shown. the record is already present in the same UI in the form of lightning ...
0
votes
1answer
16 views

Google reCAPTCHA on Visualforce - server side verification

We have the Google reCAPTCHA all set up and working (in other uses in our org), but I'm having trouble getting it to work on my VF page. Clicking the submit button fires the recaptcha and I get a ...
0
votes
1answer
16 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
7 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
11 views

Display a Pardot Custom Field on Thank You (Code) page of Form

I have a Pardot form where the person enters an Account# (field is populated already in Pardot). They hit submit, and I'd like the Thank You text in Pardot to display another field of their's based on ...
1
vote
2answers
66 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
29 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
38 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
0answers
11 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 "...
0
votes
0answers
22 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
13 views

Need to render bootstrap style in pdf [closed]

I have a Lightning Component, on a button click, which redirects to Visualforce page, Now when set renderAs='pdf', the bootstrap fails to apply styles, when I remove it applies styles properly. I ...
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-...
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 ...
1
vote
1answer
35 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.
2
votes
1answer
35 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}"> &...
0
votes
1answer
22 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
26 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 ...
2
votes
1answer
52 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 ...
1
vote
1answer
22 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
1answer
45 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
0answers
36 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
24 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
29 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
6 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
30 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
30 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="{...
2
votes
0answers
26 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 ...
0
votes
0answers
15 views

Apex page appearing in modal for sending bulk email [on hold]

So I have a modal that should contain an email contents i.e Recipients, Body and others. That content is contained my apex page. In my controller I am trying to get the email details to appear in the ...
0
votes
1answer
13 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
85 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
57 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 ...
1
vote
1answer
31 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....
0
votes
2answers
32 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({...
0
votes
2answers
35 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
2answers
54 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
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( $...
0
votes
1answer
30 views

Visual Force: can you use a javascript function to call a pagereference apex method to do a page redirect

<apex:page controller="test"> <apex:includeScript value="/soap/ajax/40.0/connection.js"/> <script type="text/javascript"> function CheckUI() { loadAndGo(); ...
0
votes
1answer
35 views

How to save HTML code from web page?

I want to send email after showing preview. For preview, I am using slds-modal in lightning component. It's layout is as shown in image. Is it possible to save html code of modal content and send it ...
0
votes
0answers
19 views

Refresh record page from popup

I have a list button which opens a popup. I am performing some operation there and when I click on 'Close' button(command button in my VF page). Then it will close the popup and refresh the detail ...
0
votes
1answer
15 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 ...