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
12 views

Using refreshApex on button click in LWCs?

I have a save and a cancel, both triggered by a button click: saveCriteria(){ let criteriaToSave = []; //reassemble drill up/down fields on the criteria for(let i = 0; i < this....
0
votes
1answer
18 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
13 views

How to get <apex:inputtext> value in javavscript?

"textvalue" is a string {get;set in my controller. Onclick of button i want to get the value of "textvalue" in my script to do some validation. vf: <apex:inputText value="{!textvalue}" styleClass="...
0
votes
1answer
12 views

JS Query variable binding

Trying to transfer an apex query to Javascript. Wondering if binding works in the same manner? Also is using result.length valid for the if statement? var accLike = '%' + 'Construction' + '%'; var ...
0
votes
0answers
19 views

Looking for advice on dealing with an asynchronous callout to Apex in LWC

I am having trouble getting a flow of operations going properly with my LWC. My issue is when a popup is created when a user clicks an edit button on a table cell, it grabs available selections for ...
1
vote
0answers
14 views

Lightning Web Component postMessage to iframe

Im migrating a lightning component that has a VF iframe that is using the postMessage function When I try to use the same function in LWC I get a the following error: Failed to execute 'postMessage' ...
0
votes
0answers
14 views

Iframe content cannot be accessed on localhost [on hold]

i have running angular application on address 'localhost:4200' and in iframe i want to display content of address 'localhost:9100' document.querySelector('iframe').contentWindow.find('div') After ...
0
votes
0answers
15 views

lightning:navigation to record edit page not working when there is an record update before it

I have a lightning component under a quick action on Account that is used for updating the record. After the update that changes the account record type, I want to open the record edit page. ...
0
votes
0answers
9 views

visualforce field validation using java script

I am fairly new to Salesforce and VisualForce. I've been asked to have my visual force input page do validation on a field. Based on information that I have gleamed from other posts, I tried to come ...
0
votes
1answer
14 views

Lightning components, what if i need it to only run JS?

I'm trying to convert a JS button into lightning. {!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")} var numTCs = {!Sales_Toolkit__c.Number_of_Theme_Conversions__c}; var curStatus = '{!...
2
votes
0answers
17 views

Javascript in Static Resources for security review but requires parameter

I have a package that was submitted for security review which requires JS to be in static resources. Required: all script and style resources must be loaded through static resources Do not load ...
0
votes
1answer
23 views

Hide and Show inputField Based upon Radio Button

I have a small problem with a validation here <script> function myFunction(V) { var inputcpf = document.getElementById("CPF"); var inputcnpj = document.getElementById("...
1
vote
1answer
21 views

How do I show an Iframe in a in a visualforce page

I am trying to show an Iframe in an visualforce page but this does not seem to render the page. I have read that this could be a certificate issue. If so is there any other way to render the Iframe ...
0
votes
1answer
44 views

element.classList.add('class-name') is ignoring the '!important' indicator in the css

This seems to me an odd problem. I have an LWC, it has an unordered list, then loops through items and creates a list item for each one. I have an onclick for my list items so when a user selects ...
0
votes
2answers
23 views

changing validation error message

I want to display an error message when a form is submitted but not all the required fields filled out. I wanted to use the "required=true" on apex:input tag but because I'm using JS function later ...
1
vote
2answers
39 views

Catch and change locale Excel date format when importing to ISO8601

I am implemeting an excel import where besides others, a date field is imported to salesforce and inserted as a record. Now I have e.g. an excel sheet where I have a date Format like 01.02.2020 or 02/...
0
votes
2answers
26 views

Unable to set component outside of FileReader().onload

I built a lightning component (incl. Controller, Apex-Controller and Helper) I want to use for excel file uploads (and importing the records to a custom object). In the Helper, I am creating a ...
0
votes
0answers
15 views

ltng Cmp: Redirect page on refresh

This is inside a community with a flow in a lightning cmp. I have a flow with sublfows going down 4 child levels. If a page is refreshed, it refreshes it from the very first flow as if the page was ...
0
votes
1answer
35 views

<aura:iteration> and input or <lightning:checkboxGroup>

I have a custom object Topics__c that I want list out like so: The text is the topic name which is a String data type. So I have to add in a checkbox along side the Name field. I have been doing some ...
0
votes
2answers
25 views

How to validate all fields with different aura:Id?

I am trying to validate all fields when the user click's on the submit button. Issue: I had to maintain different aura: id's for the lightning input elements, due to some other logic needs to be done ...
2
votes
0answers
44 views

querySelector not getting element in lightning web component

I am creating a popover, where I need to position it correctly based on the button's position that triggered it. It starts like this: <div id="popoverWrapper" class="popover-wrapper" style={...
0
votes
2answers
29 views

Can I specify where I want a data extension to be created when using server-side javascript?

the code for creating a DE is straightforward, but I'm trying to specify where I want this to be created rather than the root DE folder. Is such a thing possible? thx
-2
votes
0answers
24 views

Get maximum greater key values with object of array [closed]

let arr = [{ key = 1, name = 'testaa', dept = 'ggg' }, { key = 1, name = 'testaa', dept = 'ggg' }, { ...
0
votes
1answer
25 views

apex:inputField not getting created when created via javascript

Standard controller is already applied as case, just not mentioned here. VF Page : <apex:form> <div id="testAIF"> </div> </apex:form> From ...
0
votes
1answer
25 views

Remove selected values from the multiselect picklist in lightning

I have a lightning component which is basically a filter having two buttons, Apply All and Clear All. I would like to remove the selected values on a button click "Clear All" The filter looks like ...
0
votes
0answers
20 views

open note dialog from lightning component

is there any way to pop open the standard notes dialog from a custom lightning component? to explain: all the salesforce standard components open notes in a dialog at the bottom right of the screen....
0
votes
1answer
21 views

Change Url Params

I got lost here with an issue when I try to achieve a case which a user can click on a button and change the language of a form in visual force page. I know a way which works but don't support IE ...
0
votes
1answer
27 views

How to call java script function without refreshing page?

When I'm trying to solve witout refresh page (Map should not blink on increasing of list index). I have tried it , but it's not happening without refreshing and i want to solve this problem with java ...
0
votes
1answer
26 views

Mark the map with leaflet.js

I want to make marks on the map with the fields addresses(Shipping and Billing), the fiscal address. it's a custom field for now I do not think I'll converse on the map mark. I understand that it has ...
1
vote
1answer
33 views

Document.fullScreen API implementation in Lightning Web Components(LWC)

I was trying to achieve full screen on an element in Lightning Web Components but was unable to use Document.fullscreen API. I tried var elem = this.template.querySelector('svg'); if (elem....
0
votes
0answers
12 views

Convert javascript button for LEX

I've run the Lightning Transition Assistant and identified all the javascript buttons that need to be converted. I'm in the process of starting to manually convert the buttons to be supported in LEX. ...
0
votes
1answer
26 views

make a required field in VF page

I'm trying to make a required field input - But when I put **required=true** in the apex:input component, Its like stuck the next JavaScript-dependent part and it's not working well until I fill it ...
0
votes
1answer
11 views

Get js value and display on visualfoce page

I want to pass the value I got at js to apex. I was able to obtain the record ID obtained on the object details page with visualforce. I want to pass the acquired value to the controller and display ...
0
votes
0answers
14 views

Lightning Component: How to get the value of a dynamic generated select (inside a loop)

I have 2 arrays, one that is for my select list options, and the other is a list that needs to map to the selected list So for example, based on: List 1 = ["name", "lastname", "newout"] List 2 = ["...
0
votes
1answer
47 views

Web Component can't find variable `require`

I am trying to use the json2csv javascript package in my Salesforce Web Component, but I get the error: can't find variable 'require'. I've uploaded the json2csv package as a static resource and am ...
0
votes
1answer
18 views

JSforce - how to get the running user?

I'm following the Getting Started section on the JSforce documentation and I'm getting the following error: resource: the server responded with a status of 400 (Bad Request) INVALID_SESSION_ID ...
0
votes
0answers
15 views

Javascript button to open a VF page from Managed Package, on click asking me to login again

I have a javascript button to redirect me to a VF page from managed package. When i click on the button it is asking me to login to access that page. How do i solve this?
2
votes
1answer
67 views

Feasibility to import entire LWC classes to access @api methods

I'm looking to modularize my LWC without having to embed them in the template. Ideally, would this kind of pattern be feasible? I'm not sure if it's my lack of ES6 knowledge (modules) or that LWC ...
0
votes
0answers
31 views

Button that depends on a checkbox

I'm trying to make a checkbox (for disclaimer) - until this checkbox is checked - a submit button should be disabled. It does not seem to be much difficult and yet - I missed something here. my code ...
0
votes
1answer
21 views

Add an onclick handler to the anchor tag [closed]

I dont know Add an onclick handler to the anchor tag. I am learning with tutorial https://trailhead.salesforce.com/en/content/learn/projects/account-geolocation-app/lc-app-08 where I should put the ...
1
vote
0answers
16 views

Aligning D3 Area Chart X-Axis Ticks correctly [closed]

I am building an area chart using the D3 Library, and I used their area chart example to help me construct it. However, I am not using dates as along the x-axis, instead I am using Strings, so I tried ...
0
votes
1answer
28 views

Saving Lightning Select Value

I'm trying to display a drop down on a custom component and once a value is selected I would like to update the value in the database. I'm finally able to load the values from the database, set the ...
0
votes
0answers
44 views

smart capture javascript validation

I tried to do validation using Javascript on smart capture. When I submit the form it does not seem that the function is running. My code: Form tag: <form id="myId" class="smartcapture-content-...
0
votes
0answers
26 views

Lightning Component quickaction onclose event

Is there a way to get the close event of a lightning component that is used as a quick action? I have a component with force:LightningQuickActionWithoutHeader and I use $A.get("e.force:...
0
votes
0answers
10 views

Unable to create blob from Unit8Array or Array in lightning component javascript

There is a requirement to fetch xls file from attachments and create a lightning component to make the file download. I have written my code like this if(opwrap.FileExtension=='application/vnd.ms-...
1
vote
1answer
20 views

Open parent and child records as primary tab and sub tab in console at the same time

I am trying to open a primary tab and subtab in the console app after user clicks button on visualforce page in custom console component. The subtab would be the opportunity entered in the input field ...
2
votes
1answer
62 views

appendChild to non empty div in lightning web component

I am using a thrid party library to render certain elements in a 'container', and as per the documentation on lwc directives, I understand that I have to add a directive to specificaly indicate that ...
0
votes
2answers
80 views

JSON call using SSJS to populate a dropdown list in HTML and pass it through using AMP

I have a JSON object full of County names and I want to call it using SSJS then populate a dropdown list in HTML using the Data from the JSON. JSON looks like this [ "AZ - Maricopa", "AZ - ...
1
vote
1answer
30 views

Add map values in lightning component

I want to add javascript map values to existing lightning map type variable Map type in Component <aura:attribute name="CheckedRecsMap" type="Map" default="{}"/> In js declaring a new map ...
1
vote
1answer
43 views

Promise function in WireMethod not working properly

I am writing this wire method that when the data is loaded, it will trigger off a refresh of some other wire methods dependent on the results of this wire method. I do this by using a Promise and ...