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

Is it possible to make one css or js in common to all my Lightning web components?

Here is my situation, I have two (and soon more) LWC, inside each component, I have the classic : html, css, js and xml. In my case, the first LWC is having many css properties in common with the ...
0
votes
1answer
606 views

More detailed error reporting for SSJS failing?

We have a script which runs in an automation which retrieves registration data from our events management platform. The automation recently stopped working, and the problem was with the javascript ...
1
vote
1answer
23 views

How to read parent object value in LWC wire metho

How to read the Parent object field value in LWC, In the Below Soql fetching account.name, While reading in JS It's prints undefined Apex: @AuraEnabled (cacheable = true) public static List<...
0
votes
1answer
1k views

how to pass parent objects's id to custom button dynamically so same button can be used for all objects

I have a custom button on task related list of Account Object. The button contains the URL as: /apex/GetDynamoDBTasks?id={!Account.Id} Where GetDynamoDBTasks is a Visualforce page. I want to pass id ...
1
vote
1answer
542 views

Rerender does not work with Modal

I have a VF page which gets the folder name from the user and creates a folder in one library. The page has a button & the folders existing the library is shown using a repeater. when the button ...
1
vote
1answer
189 views

Navigate to Report from LWC

I am trying to redirect to a Report in Report Builder from a LWC. However I did not find any substantial information that specifically mentions redirection to "Report" page type , inside the ...
8
votes
3answers
6k views

How to make force:navigateToSObject to open record in new tab

Is there any way to make force:navigateToSObject event to open sObject in new tab?
0
votes
1answer
12 views

SOQL query on related records in Javascript(Visualforce page)

I have written below query in Javascript(Visualforce page) and trying to access query result as shown below, but it is failing at second console log and giving error in developer console. var ...
1
vote
1answer
384 views

Can we inject javaScript on standard edit page of contact object?

I have a requirement to make callout from standard edit page of the contact object. Is it possible to inject javascript on standard inline edit page or standard edit view page.
0
votes
0answers
10 views
0
votes
0answers
19 views

How to handle multiple alerts functions in lightning [closed]

Currently, I'm working on the lightning transition and in the process i'm trying to convert the below javascript button which contains multiple if conditions & alert statements. I have tried ...
0
votes
1answer
16 views

Why I get this [productCart.has is not a function]

MainComponentController handleClickAddToCartEvent: function(component, event, helper) { let product = event.getParam("product"); let productCart = component.get("v.productCart"...
0
votes
1answer
27 views

$A.util.isempty returns false when no value is present

I'm trying to create new record through the lightning component but the criteria for required fields is not checked properly. $A.util.isempty is used to check the required fields but even for empty ...
0
votes
2answers
608 views

<apex:actionFunction not calling Apex methods

I am trying to call an apex method from my visualforce page using javascript method. <apex:page docType="html-5.0" showHeader="false" expires="" sidebar="false" title="Connection" controller="...
1
vote
2answers
31 views

Date requirement when checkbox is True in aura component

Hi my requirement is: When select checkbox, then need to display Date as follow: When checkbox selected, Date should be year ending 1231. Pls find my code below in controller: component.set("...
1
vote
2answers
47 views

Concatenate two Values in a LWC (Lightning Web Component)

I am currently grabbing field values from a Lead and displaying them onto a LWC. I am having trouble taking two values and placing them into a variable. Here is my JS: // ********************* // ...
2
votes
1answer
52 views

LWC best practice to fetch apex data

I have an LWC page with three section getting data from 3 apex methods all are returning a list of wrapper class, my requirement is lesser initial load time of the page, to fetch data from apex I have ...
0
votes
1answer
24 views

Comparing Strings results in a wrong answer in lighting component

I have a lightning component where I am trying to compare the user's profile Id and based on the result execute some logic but the result I get in the compare is wrong - although the IDs are the same ...
0
votes
1answer
39 views

Obfuscate or Encrypt LWC Source Code

I am facing some problems with data injection in LWC where a user is able to set breakpoints in the javascript and change values to get data that they don't have access to. Changes are being made to ...
1
vote
1answer
476 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
1answer
473 views

I am getting error when i was open my visualforce page in safari , Ipad ,Iphone

My lightning component is open through a visualforce page. It work fine in Chrome ,Firefox and IE web browser. But when we open this visulaforce page in mobile or in safari browser it give error ...
1
vote
1answer
21 views

How to show percentage while waiting for promise object in LWC

I have below method in JS where I do server call from a click of a button, now the requirement is to display percentage while waiting for promise object and to do the same currently I am increasing ...
2
votes
1answer
969 views

Accessing Array Elements in Target

I'm working on a component to track Estimated Crop Plans for farmers. It's quite simple: we need to get the Crop and the number of Acres to be seeded. The component stores an array of crops and acres ...
1
vote
0answers
36 views

Google Analytics Event Tracking in Community using LWC

I'd like to use Google Analytics Event Tracking inside a Community in LWC We have Google Analytics configured in Builder > Settings > Advanced > Google Analytics The documentation says to ...
1
vote
2answers
904 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
0answers
11 views

Suppress Pause Reason Question in a Screen Flow

Context We have a Screen Flow built in Lightning Flow Builder. The flow is exposed to members of the public through being embedded in a Lightning Aura Component placed on a page in a Community. When ...
0
votes
0answers
20 views

Is there any way to make aura component handle a event captured from javascript api in static resource?

Do you know how to make aura component handle an event captured from External javascript api? The process likes below: 1. A javascript api is in the static resource. 2. Aura component contains the ...
0
votes
0answers
28 views

how to update field in Lightning Web Component?

In my Lightning Web Component, I have a picklist field called Applicant_attendance__C according to the value of the picklist field the Stage__c field should get updated. Stage field is a read-only ...
0
votes
1answer
23 views

how get map value and keys which I got (let fieldVAlues =response.getReturnValue();) from the apex method(getPicklistValues)

ComponentController getPicklistValues : function(component) { // let fields = component.get("v.picklistfieldMap"); let fields = new Map([ ['v.typeMizerOptions' ,'...
0
votes
0answers
20 views

Take all value from childe component

I have a question, cuz i have two components, my parent and childe. Child component contains all types of input, and this imputs throwing new customEvent onchange so every single time when i type ...
0
votes
0answers
24 views

Lightning Web Component Navigation Mixing

From One LWC I am trying to open the custom object New Creation Page but getting below error : "This page isn't available in Salesforce Lightning Experience or mobile app" Below is the codes ...
0
votes
1answer
43 views

Can't use Highcharts in LWC

I have included https://code.highcharts.com/highcharts.js as static resource (in format text/javascript) in my org. When I tried a sample demo code, there is always a message saying .chart is not a ...
1
vote
2answers
58 views

How to get return value from helper class to controller class?

I want to have the value of Helper class's function who calls Apex method and return the state to controller from where it is being called? For eg. below is the code : DummyController.js ...
1
vote
1answer
530 views

Issue in console event listener

I have recently enabled omnichannel in our org. I need to perform some action when an agent accepts a post from the omnichannel widget in the console. To do this I added a hidden custom console ...
1
vote
1answer
32 views

Convert JavaScript List Button to Lightning

I have a js list button which opens up new record (on edit mode) and pre-populate fields. I'm trying to figure out - what is the best way to convert this button to be lightning ready, but also keep ...
0
votes
1answer
42 views

Affix a Div while scrolling

I have two sections in an LWC and the section 1 contains lot of data hence that section scrolls. The section 2 is a fixed size div which has inner scrolling. Now I need the div on the right side(the ...
0
votes
0answers
37 views

how to capture touch event in lightning component?

Is there any way to capture touch functionality in touch mobile screen. currently i am using the onmousedown="{!c.onMouseDown} function to capture the mouse click events, but now for mobile screen i ...
1
vote
3answers
499 views

Document.getElementId() not working for some div's in Salesforce Summer'16 release

Since Summer'16 release, I have been getting many issues in Lightning components, resolving them by moving all my JQuery to Vanilla JavaScript. Currently, I am getting an error in Vanilla JS while ...
0
votes
1answer
18 views

IE 11 browser treating input number field as input text by allowing non numeric values

I have a form in a visualforce page where it contains an input number field. In the IE 11 browser users are able to enter invalid characters such as letters and commas. I have tested in Chrome, ...
0
votes
1answer
34 views

Return an Instance of a Class in a LWC (Lightning Web Component)

Below I am Trying to Return an Instance of a Class to a LWC JS to then handle and display to the End User. I am able to successfully call the Apex Class and Method and return data, but the data is ...
0
votes
1answer
20 views

How to clear and start timer in lightning component with button click?

I have a scenario where i need to clear the time interval with a button click and start the time interval with another click. Right now when the page loads(refreshNotifications), the time interval ...
0
votes
0answers
30 views

Code for sorting of a column of datatable in LWC

I have a requirement where I need to sort based on a column of datatable. I found the code in lightning datatable component reference. I inserted the code and it started sorting. I did not find an ...
0
votes
1answer
33 views

getFieldValue not working properly in LWC

I am trying to retrieve the field value once a record is created and submit button is pressed. So I am getting the record Id via event.detail.id in my js but I tried retrieving the value with the Id ...
0
votes
0answers
30 views

Open sofrce createRecord in aura in popup modal instead of subtab in console

I am trying to open "Standard Task" create page in console but its opening as a subtab. I need to open it as a modal popup on same lightning recordpage. Please help. var createRecordEvent = $A.get('...
0
votes
1answer
477 views

How to display Public groups in drop down list in visualforce page?

How to display Public groups in drop down list and in this list select one public group,then search button clicks need to display the users in particular public group? anybody help me......
1
vote
1answer
454 views

List View Multiple Case Owner Update

I have used the below piece of code to select multiple cases from list view and update case owner. But it does not update the owner when I am selecting multiple cases while it works when I select only ...
1
vote
2answers
5k views

How to refresh contents of modal on button click? (VF Page)

I'm using a modal that has as input fields object fields linked to the controller. After filling the modal I send the "experience" to the controller and save it and send back an empty singlExp so that ...
0
votes
1answer
24 views

Using Design:attribute in a Visualforce page

I currently have an aura component with which has a design:attribute as an input for when the component is used in a community to help the admin configure it. I would like to use that inputted ...
1
vote
1answer
47 views

JavaScript Error: Uncaught (in promise) undefined - when using FullCalendar 4.4.0 in LWC component

I am trying to use FullCalendar 4.4.0 Timeline View inside a LWC component. html <template> <section class="slds-card slds-p-around_medium"> <div class="calendar" lwc:dom="...
0
votes
1answer
24 views

How to assign value to global variable in Javascript with a button click?

Is there any way to assign value to global variable in salesforce helper javascript? Helper ({ resetTime: 30000, refreshNotif: function(component, helper) { window.setInterval( ...

1
2
3 4 5
82