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

Pass value from JavaScript to Controller [on hold]

I need to pass user input from javascript in visualforce button to Apex controller, to add it to field. Can anyone hep me with it please?
1
vote
1answer
30 views

How to use an apex class variable in LWC javascript?

I have a constants class that has: public static final String DATA_TYPE_INTEGER = 'INTEGER'; I tried to access this in my LWC by doing an import like this: import DATA_TYPE_INTEGER from '@...
3
votes
1answer
50 views
+50

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' ...
6
votes
1answer
144 views

Is User Interface API accessible via JS from a Helper of a Lightning Component?

Can we use the UI API in Lightning Components directly from within a Helper JS? https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_get_started.htm I've just read the docs and ...
0
votes
1answer
25 views

How to modify inner html value in lightning component?

I want to set inner html value dynamically from custom label . <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1"> Lightning controller : var hideElement = ...
0
votes
1answer
13 views

Window.open - size - multiple monitors

I am trying to open new window from a lightning component using window.open I want to center this new window in the middle of the screen. for this I am using this code : var myWidth= 600; ...
0
votes
2answers
638 views

Removing Search Box From Partner/Community Portal?

I want to remove the search box from the portal. After doing some research I found some useful guidance that this is possible using jquery. I tried to implement the jQuery in the Home Page components ...
0
votes
1answer
22 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
12 views

Syntax to dynamically set nested property?

I have a lightning-datatable with editable columns. When changes are made and the user presses Save, it calls handleSave(event), which pulls the draftValues and will call Apex to update the records. ...
0
votes
0answers
6 views

Drag a file card lightning component to custom email action using Dragula JS [on hold]

I have a requirement where I need to drag the attachment from Case object to the email action to attach the attachment. I will create a custom component to show the attached files into the file card ...
2
votes
1answer
354 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
1answer
27 views

Find Website Button

I have a button that finds the website if it's in Salesforce or if blank, uses the email domain or uses the Company name. Someone decided to enter "http://No website (Date)" in a host of Website ...
0
votes
0answers
24 views

Using refreshApex on button click in LWCs? [duplicate]

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....
8
votes
3answers
3k views

Is it possible to call a Lightning Component from a Javascript function?

I am using a jQuery Datatable inside one of my lightning components, and would like to call another lightning component on click of one of the fields in the Datatable. On click of the "edit" field ...
0
votes
1answer
16 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
13 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
22 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 ...
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
15 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 = '{!...
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 ...
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
24 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
23 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 ...
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/...
1
vote
3answers
894 views

Not showing file name in SLDS File Selector

I am using SLDS on VF page and I am using File selector input and when I upload file , It does not show me the selected filename next to it. Here is my code. <div class="slds-form-element"> &...
0
votes
2answers
25 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 ...
5
votes
2answers
427 views

Disabling custom javascript button

I need to disable one of the custom javascript buttons after the first click. I've found that I can use(and I actually did use this in the past) this 2 lines of code to disable a button: this....
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
16 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
37 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
26 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 ...
0
votes
1answer
340 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 ...
2
votes
0answers
45 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={...
1
vote
2answers
398 views

SSJS indexOf not supported?

I have the following array, and would like to determine whether the a value is contained in the array using indexOf. var testarray = ["RiskCCMismatch", "ContentVersion"] var testresult = testarray....
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
1
vote
1answer
358 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
351 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 ...
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
28 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
2answers
379 views

How do I put one function as a callback in my helper method?

I've got this helper method with two functions in it. One function that creates a lead and another function to load a specific record where the recently created lead is populated on a lookup field. ...
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....
1
vote
1answer
355 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' }); ...
1
vote
1answer
44 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 ...
1
vote
2answers
362 views

Web to Lead, Date showing in Debug page, but not in the Lead

My contact for is using 2 date pickets, Check-in/Check-out dates. When I fill out the form the dates show fine in the debug page. I receive and email with a link to view the lead and the dates are ...
1
vote
1answer
363 views

Invoking another component in lightning salesforce

In my lightning component, calling a method on onclick event and in turn which calls an another component. which works fine but whenever the page is refreshed it fails to call the component on First ...
0
votes
1answer
23 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 ...
1
vote
1answer
359 views

Using Custom Compact layout on Visualforce Page

I have a visual force page displaying lots of information in a report of sorts. To enchance the user experience I have added some code to load the standard compact layout for records to provide some ...