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
4
votes
2answers
431 views

The first parameter of loadScript() and loadStyle() must be an LWC component

I have a strange problem with the component and I don't know what more can i do, I'm having this problem whenever I put the lwc inside the recordPage of a custom object but in a standard recordPage ...
1
vote
1answer
427 views

Automatically show the Choose file option/button when a checkbox is selected

Suppose I have one checkbox and one inputfile (Choose File). The idea is whenever I select/check the checkbox (checkbox value=true) then the ChooseFile (inputfile) will be automatically displayed in ...
0
votes
0answers
16 views

issue in creating record by hovering on related list link

i have a javascript button (OverRidden the standard create contact button)to create a contact record from account detailpage, which opens a vf page in model window and after clicking on save the ...
0
votes
0answers
16 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
1answer
539 views

SSJS script does not update a Data Extension field when using running the script via the Script Activity in Marketing Cloud

I am trying to run the script below in the Marketing Cloud Script Activity to update data in a Data Extension: <script runat="server"> Platform.Load("core","1"); try { var ...
5
votes
1answer
155 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
1answer
702 views

How to check live agent availability from apex?

I've been using JavaScript to check live agents availability for a while now and it was working fine until a recent change of requirements. This is what I currently do: if (!window._laq) { window....
0
votes
0answers
9 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 ...
3
votes
1answer
586 views

JSForce - getting OAUTH2 refreshToken - variable app is not defined

I am clearly missing something called app here. I am following Authorization Request section from the documentation. It says your app is callbacked from Salesforce with authorization code in URL ...
13
votes
1answer
586 views

Lightning Components: Why is the rendering of 3-level nested <aura:iteration>'s so slow?

I have been working with a nested iteration and it is causing a delay of >3 seconds AFTER loading things from the APEX controller. The APEX response itself is fast, so I'm not looking for any APEX ...
0
votes
1answer
29 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 ...
2
votes
1answer
34 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" ...
3
votes
1answer
460 views

Javascript in custom button

I created a custom button with the send email features, so if the margin<0.4) show alert, than can't send the email. I created the button but it doesn't work. Somebody can help me? {!...
0
votes
1answer
438 views

Get values from child page

I am creating an custom vf page for opportunity. I am having 5 input text box which has an lookup. on click of this lookup an pop up should get displayed(i.e custon child page) and should select ...
0
votes
0answers
11 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
2answers
2k 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 ...
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
46 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
23 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
31 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
13 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
500 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
17 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
166 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
46 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
46 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
41 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
790 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
54 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
25 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
17 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
67 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
488 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
552 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
58 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
29 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
52 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
541 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
615 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
128 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
581 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
79 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
111 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
31 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
129 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
8 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
32 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: [...] [...