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.

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="{...
2
votes
0answers
28 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
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
87 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
58 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
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....
0
votes
2answers
40 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
36 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
60 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
31 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
36 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
20 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
16 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 ...
0
votes
1answer
24 views

getting value from controller to VF page

I have a function inside my apex controller : public List<Decimal> getcheckProductMaxMinPrice(){ List<Decimal> listDeci = new List<Decimal>(); listDeci.add(5.0); ...
0
votes
1answer
45 views

Convert this visuaforce - Javascript to Lighning

I have requirement to transform this code into lightning. I can see that sforce.connection.query is not working in lightning. I am new into lightning development and not sure what is the best approach ...
0
votes
1answer
29 views

replace function in JS controller Lightning

I want to replace the call back response with the component value. var actionAcc = component.get("c.getPickupLineItems"); // alert("pickup response: " +actionAcc); actionAcc.setParams({ ...
3
votes
1answer
40 views

Helper method not calling other helper method

I'm trying to break logic into a few separate chunks, but hitting a snag. The basic structure of my helper looks like: ({ foo: function (component) { console.log(this.bar); // <-- ...
4
votes
2answers
257 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
2answers
55 views

@RemoteAction in Lightning web components [closed]

How i can migrate this code to Lightning web component: <div id="totalAccounts"></div> <script> Visualforce.remoting.Manager.invokeAction( '{...
3
votes
2answers
129 views

Why without the JSON.parse method, I can't sort the data in lightning-datatable?

I'd like to understand the usefulness of the method JSON.parse in the JS file of a lwc when we want to perform certain actions on a list of objects retrieved from our apex controller. I give you an ...
2
votes
2answers
154 views

How to load and use external library?

I don't know how to use the library of Pagination in a lightning web component but I can't use the example method: $('#demo').pagination({ dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 195], ...
1
vote
1answer
35 views

Pagination error

I want to do a paging, but I'm having some problems. When I select the page number in pagination, the "selected" class is applied to the position and not to the number itself. My HTML: <template&...
0
votes
1answer
32 views

Lightning Component - Copy Canvas to Clipboard

I'm trying to copy the image of a canvas to my clipboard in a lightning component using javascript. So far I have this in my helper: copyData: function() { this.canvas = component.find("canvas")....
1
vote
1answer
29 views

Unable to navigate to community page using <lightning:navigation

I am using a <lightning:verticalNavigation> which calls a method to redirect to a Lightning Community page. Component <lightning:navigation aura:id="navService" /> <lightning:...
1
vote
0answers
53 views

SSJS script activity not updating Query Definition as expected

I am trying to update a query definition in Marketing cloud using SSJS script which updates the query based on the datestamp. When I run the script, I don't get any error but it does not seem to be ...
1
vote
0answers
46 views

DOM Exception JSON.stringify - Error in Console

Updates: ----Latest Update---- I am able to convert the event to a string with dojox and their serializer that allows circular objects to be stringified. I originally tried to include dojox via a ...
0
votes
1answer
32 views

Lightning PageReference Object Passing Field Values in standard__object

I am launching a Subtab using the Lightning Workspace API, and using an Aura pageReference object to specify that I want to create a new Task. I want to pre-populate the WhatId on the Task when the ...
0
votes
1answer
25 views

Jsforce where clause having multiple conditions not working

This below code results in INVALID_FIELD: Test' AND ParentId = null AND EndDate > '2019-05-21' LIMIT 1 error.. How can I add more than one condition in where clasue? const a = 2019-01-03 const b = ...
0
votes
0answers
21 views

Create a button that works everywhere in lightning [duplicate]

Hey so basically i want to create a button that i can use anywhere to open a link to URL in UAT. The create custom buttons in or quick actions in sandbox are kind of restricted like i can use the ...
1
vote
1answer
42 views

.set and .setCustomValidity not working for two checkboxes

I am trying to place a custom validation if atleast one of my checkboxes is selected or not. and show the relevant error message. I am able to achieve this when there is only one checkbox , HOWEVER ...
0
votes
1answer
65 views

How to access client side javascript variable in SSJS?

I am facing difficulties in showing a message. Below is the problem statement : I have six textboxes on a cloud page which stores six digit coupon code(one digit each). I am trying to show a error ...
0
votes
0answers
33 views

sforce is not defined in UAT, but in sandbox yes

I'm having this problem, and I've tried all the solutions that can be found in this world to resolve; I'm working with the opencti APIs, in an aura component, in the sandbox the component runs fine (...
0
votes
0answers
23 views

How to Pass record id from community page to another?

I am using navigation mixin for navigating to a community page from other community page- this[NavigationMixin.Navigate]({ type: 'standard__namedPage', attributes: { ...
1
vote
0answers
14 views

Capture Browser Click Events from Console Component

I am trying to capture all clicks in the salesforce classic console from a script in a custom console component. The following javascript logs all onclick events in the console in the frame of that ...
0
votes
1answer
16 views

I have an error while moving to 'Setup' screen from 'Home' page in SF sandbox

while moving from Home to Setup page, navigating from button at right upper corner in sales-cloud enterprise edition. I am facing this from last 1 hour.
3
votes
1answer
81 views

How to display lable to a url cell in LWC datatable?

I am trying to build a datatable in lwc and one of the column's datatype is url. When I provide URL it shows as https://www.google.com , what I want is just label "Google.com". I can see from the ...
0
votes
1answer
30 views

Use of Map (Collection) in Lightning Component JS

I'm preparing a Map and doing some operations var tempParentMap = new Map(); tempParentMap[key] = someList; This code works when I iterate through forEach loop Like: Object.keys(tempParentMap)....
0
votes
0answers
17 views

Jquery inside apexpageblocktable

I am having a pageblock table with three picklists. based on one picklist value and text the second picklist would generate the values and based on selected second picklist value and text the third ...
0
votes
2answers
64 views

Set picklist field on object using Lightning Data Service

I have a field, Region__c, on my Case object that is a picklist. I am trying to set this field in JS using Lightning Data Service. When using component, set it doesn't seem to be sticking. Any ideas ...
0
votes
1answer
25 views

campinglistformcontroller.js can't insert form in database trailhead

I'm stuck at the last component Aura challenge, I managed the challenge but when I try to insert a form in the database it makes me mistakes. I tested with two submitform function ...
0
votes
0answers
19 views

How to enable right click open new tab option along with the feature of left click that opens in same tab in visual force page

We have a custome emails section where we can open the email message if we click on the email subject. Below VF code we are using to achieve this. <apex:column headerValue="Subject"> <a ...
0
votes
1answer
28 views

how to limit the data to be displayed from the long text area field in the visual force page?

We have developed a custome emails section through custom vf page. Need to display the sub string of text body from the email message object. Below is the custome email section we have developed : ...
0
votes
0answers
25 views

VF phone number display format

I would like to do one input text of phone number with bottom border only and the phone is separated into two parts: area code + number on the next format : XXX-XXXXXXX Within one input. It's mean ...
0
votes
1answer
61 views

Is it possible to call an intranet or local server using a lightning component?

For example, if a local server outputs a JSON with sensitive information, and I can access it through my local network, can I access this data using a lightning component?
1
vote
2answers
55 views

How to add an onchange event to a <input type=“file”

I am unable to get a <lightning:fileUpload> to work on a public community page, so I need to write a custom upload component. I want to fire an onchange event after the user selects a file ...
1
vote
0answers
24 views

Multiple filters for same field in wave:update

I'm developing a Salesforce Aura component that updates an existing Wave Analytics dashboard whenever something changes within the component. Those changes may affect same field with several values ...
0
votes
1answer
25 views

How do I create a single Instance of an object and upload multiple attachments for that object in lightning?

When I'm uploading an attachment every time, on Clicking of the Save button which calls the function using javascript in Lightning Component, it creates an Instance of an Object whose ParentId I'm ...
0
votes
2answers
30 views

Lightning Component Display Integer from Apex Class

I have created an Apex class which takes the opportunity Id and finds me the days between two today and future date, what i'm now struggling to do is display this within my lightning aura component. ...
0
votes
1answer
29 views

Complete component reload

I need one of my own component to completely reload itself when a given event occurs. By this, I mean I need it to load itself as if the page it is contained in was loaded the first time ; this, ...