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
1answer
399 views

Passing values using actionfunction with javascript not working

I'm trying to filter a page based on two dates, this is my current actionFunction: <apex:actionFunction action="{!modifySoQLBasedOnNewDataRange}" name="passDateValues" status="loadingDiv"> <...
0
votes
2answers
3k views

Creating Custom Form and putting info into Data Extension

I would like to know if its possible to create a custom Form. For example, it will have 2 fields. Name and DOB. I can perform a validate via Javascript, but once onsubmit is true, I would like it to ...
3
votes
1answer
60 views

LWC component not rendering

I have a lightning web component that wires an apex method that calls out to JSONplaceholder.com to get back some data. I'm having issue with the whole component rendering at all. While in community ...
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 ...
2
votes
1answer
394 views

SOQL query to find out if user exists in public group in Javascript

Can anyone help me to query whether the current user is a member of public group in Javascript button on click. I've gone through many blogs but nothing struck to my eyesight which will be of help. If ...
0
votes
0answers
11 views

Salesforce CPQ - Quote Calculator Plugin - How to access Account Name

I need to access Account Name from Quote Calculator Plugin. Sample code snippet is as below - export function onBeforeCalculate(quoteModel, lineModels) { alert(quoteModel.record["Account__r"]["Name"]...
2
votes
3answers
2k views

Binding a click event to document Lightning Component

I am using SLDS Picklist in Aura Component, I am trying to close the picklist when user clicked outside the picklist. I am trying to bind a click event to document and call the action to close the ...
1
vote
1answer
714 views

Blocked by CORS policy: No 'Access-Control-Allow-Origin' header on the requested resource

I am trying to use a Google Charting library inside a Lightning Aura Component. Component <aura:component implements="flexipage:availableForAllPageTypes"> <ltng:require scripts="{!$...
0
votes
1answer
426 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 ...
0
votes
0answers
9 views

Is there a mail sending structure in Salesforce(Automatic) or Can i use custom button in mailchimp commands

Firsty hello friends i need the custom button on the case object detail and i want to send mail test(lead or contact) doesnt matter this now i found this code: JS: var singleRequest = new sforce....
1
vote
1answer
33 views

How to change the value of a input field on select

I am trying to update the selected value from pop up to the input fields. But the value is not getting reflected on UI. If any one have any idea please help below is my code HTML <template> &...
0
votes
0answers
23 views

Update values in JavaScript Functions - VF page

I have a VF page which has a commandLink button which used for adding values to a table. I want to display success or error messages on different lang base on a custom Setting object. I'm using "...
1
vote
2answers
24 views

Connect two Lightning li elements by line

I'm utilizing this repo to create a custom kanban. I'm able to generate a list of tasks in my system but the trouble I'm having is drawing a line to connect two tasks together. The idea is to show ...
0
votes
1answer
17 views

Cannont set property 'Name' of null map

I want to fill a Map the name as key and value as value of each input cmp <aura:attribute name="mapDataCible" type="Map" access="global"/> Js //i get all input const myInput = ...
0
votes
1answer
23 views

Create a constant for “this” in Lightning helper

Is there any possibility to create a constant for "this" in Lightning helper? I have tried the following syntaxis: self : this, initializeInputs : function(component, webLeadData) {} But I receive ...
0
votes
2answers
509 views

event.target.value returns [object object] on onClick

component pseudo code <aura:iteration var="PIW" items="{!v.objInfo}"> <thead> <tr> <th> <button ...
0
votes
0answers
10 views

Lightning Experience Configuration Converter

I have converted and deployed the buttons into quick action using the tool.The converted actions are placed under the Salesforce Mobile and Lightning Experience Actions, but it is not showing up in ...
1
vote
3answers
7k views

How to access Apex:Variable in Javascript

I have a Visualforce Page that uses a standard controller for custom object and an extension. In the extension I have a method that get details of selected record, which is selected in select control. ...
0
votes
1answer
20 views

Problem with lightning input pattern

How do I ensure that the user only types numbers in lightning: input? Currently tried with pattern but to no avail: <lightning:input type="text" label="Numeric value" aura:id="myInput" name="...
1
vote
1answer
396 views

Use JSForce to connect with a community/portal user

it possible to connect to sales force with a community license user using jsforce? This is what I have tried let conn = new jsforce.Connection({ loginUrl : 'https://login.salesforce.com' }); ...
3
votes
1answer
46 views

How can i Call Apex Controller Class in Custom Button through JavaScript

Button {!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")} sforce.apex.execute("LeadConversion","show",{}); Apex Class global class LeadConversion { ...
0
votes
1answer
30 views

Force download in Salesforce HTML Download Link

I'm adding a link to a Salesforce page with some JavaScript and I want to force the corresponding link to download. At the moment it's just displaying the image in my browser (current version of ...
1
vote
1answer
352 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
1answer
33 views

Available Lightning Controller Data Types

Where can I find a list of the acceptable datatypes for the lightning controller component.set() for list values? I can see that type: 'text' and type: 'date' and type: 'boolean' work but integer and ...
0
votes
2answers
361 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="...
0
votes
1answer
305 views

Using Google translate APIs in Lightning components

How can we translate all the contents in a lightning component to the User's native language (not just by using labels) ? Is it possible by using google translate APIs if we can get the current user'...
0
votes
1answer
22 views

when i click on text its checkbox automatically checkbox must checked in visualforce Page

<apex:page controller="Apexclassforaccandcheck"> <apex:form> <apex:pageBlock> <apex:dataTable value="{!acw}" var="aa"> <apex:column><apex:...
3
votes
1answer
407 views

D3 JS Library not working with Web Components

I am attempting to follow this documentation to create a very simple bar graph, however, it seems as though Salesforce has no idea what is in my D3 static resource as it says ____ is not a function ...
3
votes
2answers
1k views

How to use progress ring with lightning component

In recent release salesforce has released progress ring part of SLDS. https://www.lightningdesignsystem.com/components/progress-ring/#content I am little confused on how to use this with lightning ...
2
votes
1answer
95 views

How to use custom LWC lightning component in lightning-datatable

If we want to have custom lightning component in LWC lightning-datatable, for example Upload file for each of the records, how can we do that?
0
votes
1answer
18 views

Chinese Characters Included in Subject When GMail Sends Mail Can't Be Displayed Correctly

I send a mail in javascript via GMail API. If mail subject has Chinese Characters,it cant't display correctly in GMail Inbox. And message has Chinese Characters no problem. var email = ''; email = '...
0
votes
0answers
13 views

How to copy js object from one variable to another

I have a problem in javascript controller while assigning response. I have response "response.getReturnValue()" from setCallback function which is a list of records. I want to assign this to 2 ...
1
vote
1answer
41 views

Unable to download CSV File from javascript

I have created a custom button. When user click on that button, it will redirect to a visualforce page. There I have written some code to download CSV file. Code: const rows = [ ...
1
vote
0answers
201 views

Migration of Onclick javascript custom links from salesforce classic to lightning

I have a custom OnClick JavaScript link that is used for Quote functionality.  The OnClick JavaScript will not work with Lightning.  How should I migrate it to lightning on click of the link a popout ...
3
votes
1answer
115 views

How to print iframe in Lightning Component

I have a Lightning component which has an iframe to a visualforce page: <aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId"> <iframe aura:id="myFrame" ...
2
votes
1answer
638 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 ...
0
votes
1answer
14 views

Not able to set blank values to prepopulated fields in lightning

I am trying to set blank values for a few fields that are prepopulated. I'm trying to blank the values in the doinit method of the javascript controller. Below is the code: Component: ...
0
votes
1answer
29 views

Get DOM handle for a class from parent (higher) component

Question: I want to access all the child nodes that contain class .socket-in from Higher order component (preferred) or atleast Pills. However, I've tried document.querySelectorAll('.socket-in') and ...
0
votes
2answers
70 views

Locker Service and 3rd party library, how to pass Security review?

Is it a way to use 3rd party library/framework like Vue/Angular and bypass security review by Salesforce. Because only option to use those kind of library seems possible with version 39.0 which is ...
0
votes
1answer
372 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
84 views

event.getSource() alternative in LWC? (considering origin reparenting)

Consider below component chain in Aura: <c:parent> <c:child> <c:grandChild> When grandChild fires event, we can get hold of the source component by using event....
0
votes
0answers
17 views

Is it there anyway to get multiple imports from the a Apex controller using using a single import statement using LWC [duplicate]

I would like to have one statement to get multiple apex controller methods: import { LightningElement, track, wire } from 'lwc'; import { getThis, getThat, cancelThis, cancelThat } ...
0
votes
2answers
42 views

How to determine if someone clicked on the CTA on cloud page?

I'm trying to track the contacts by logging them into a DE as soon as they click on a CTA on cloud page. I'm using onclick event and passing the value to a variable and then trying to pass the Javavar ...
2
votes
1answer
132 views

Download file from URL to Safehouse

is there a way in ampscript or javascript to download a file from a WEB-Url and store it to the safehouse ?!?
1
vote
2answers
67 views

LWC Wiring apex method returns [object Object]

I'm trying to display the account of the logged in community user. Right now i'm only trying to display the Id but it's returning [object Object]. Maybe i'm not going about it the right way. Here is ...
0
votes
1answer
19 views

get row onclick table in lightning

how can I get the row I clicked from table ? so that I can recover the data I want. the click is working <aura:iteration items="{!v.data}" var="row"> <tr class="slds-hint-...
0
votes
0answers
29 views

Script in ltng:require Blocked by Locker Service

I added a JavaScript file to a Static Resource and I'm using ltng:require to reference it in a Lightning component. <ltng:require scripts="{!$Resource.MyCommunity + '/js/myscript.js'}" ...
4
votes
0answers
56 views

Calling Apex only fails when set (cachable=true)

I have an Account List Lightning Web Component (LWC) that is calling a (cachable=true) Controller method on load and when someone in the UI changes a filter string. The always works as long as the ...
1
vote
1answer
64 views

Setting Style through JS

I would like to know if this method exist in JS JS this.template.querySelector(".month").display='none'; HTML <h3>Month</h3> <lightning-input name="Month" label="...
1
vote
1answer
396 views

How can I lookup/filter rows in exacttarget with a date field in the future?

Date filtering seems to either be difficult in Exact Target or just poorly documented. I'm trying to filter to only show future items. Given a data extension SomeExtension with a Date field called ...