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.

1,286 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10 votes
0 answers
4k views

'Script Error' in my Lightning Component?

I have a component: <aura:component controller="FileUploadController"> <ltng:require styles="{!join(',', $Resource.DropZone + '/basic.min.css', $...
Tyler Dahle's user avatar
  • 2,679
9 votes
2 answers
675 views

accessing a lighning inputField lookup name client side

I am easily able to fetch a lookup ID from a inputField <lightning:recordEditForm objectApiName="Case"> <!-- the messages component is for error messages --> <...
glls's user avatar
  • 20.1k
8 votes
2 answers
4k views

How to dynamically import a module in lwc

I am trying to import modules dynamically in my LWC component. While pushing the change I get a strange error LWC1509: This experimental syntax requires enabling the parser plugin: 'dynamicImport' ...
Anmol Kumar's user avatar
  • 3,599
7 votes
1 answer
433 views

Locale Supported Format For Visualforce Input Field

I've been rewriting a Visualforce page to use SLDS styling. Part of this requires rewriting dynamics DateTIme fields to SLDS Date time picker. This therefore means writing the Date part of the ...
RedQueries's user avatar
6 votes
0 answers
854 views

Visualforce Remoting: Javascript proxies were not generated for controller QuoteLayout: may not use public remoted methods inside an iframe

I've looked at all of these solutions here on SFDC stack exchange (1) (2) (3). I followed them for what applied to what I'm doing and I'm still getting this error. I made my apex class global ...
Kruse in Salesforce's user avatar
6 votes
0 answers
435 views

Hitting error when trying to save HTML5 canvas in VisualForce Page

We have a requirement to open an image attachment in a VisualForce page, the user should be able to draw on the image and those edits should be updated in the attachment on save. So to achieve this, ...
Varghese Kiran's user avatar
5 votes
0 answers
244 views

Visualforce Action Button on Lightning Record Page leaves an entry in browser history causing re-execution. Can this be prevented?

(NOT SURE, BUT THIS ISSUE MIGHT BE A SALESFORCE BUG OR AT LEAST AN INCONSISTENCY) I have defined an Action of type "Custom Visualforce" like this The button for this Action is "◈ Clone&...
Uwe Heim's user avatar
  • 28.3k
5 votes
1 answer
1k views

trying to build org chart using OrgChatJs in LWC

I am trying to build a Org Chart using OrgChatJS (https://balkan.app/OrgChartJS/Docs/GettingStarted) in LWC . It will look like this But in Salesforce , its coming a blank page. Anything i am ...
sfdc_to_learn's user avatar
5 votes
0 answers
379 views

Font Awesome fonts are not being loaded after "Enable Secure Static Resources" activated for testing

Recently I have encountered the feature "Enable Secure Static Resources" on the release update (that was already being postponed as I am writing this) and read this question talking about it ...
Mohamed Houssein Douici's user avatar
5 votes
1 answer
1k views

Using third party javascript library in LWC without a static resource

My question is similar to this. It seems we need to upload the Javascript library as a static resource before we can use it in LWC. I've got a payment gateway JS library which I need to use via CDN ...
Pasan Eeriyagama's user avatar
5 votes
1 answer
3k 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 ...
Robs's user avatar
  • 9,330
5 votes
0 answers
877 views

Modal being rendered in wrong position on lightning web component's mobile page

What I want I'm trying to show a modal to warn the user when the service he is trying to reach is offline. This salesforce page is accessed by Salesforce1 through a tablet. How I did I've created a ...
Igor Santana's user avatar
5 votes
1 answer
330 views

Why does a lookup to custom object on sites give invalid ID?

I am developing an internal site for all company employees (basically an intranet). I am using a visualforce page but it must be externally available because not all company employees have a ...
Berg's user avatar
  • 1,055
5 votes
0 answers
851 views

'orientationchange' doesn't seem to be working in S1

Recently started using S1. Developing a web app and trying to listen out for orientation change on iPad. This works perfectly in full site mode on the iPad function doOnOrientationChange() { ...
Daft's user avatar
  • 2,661
5 votes
1 answer
1k views

How to load static javascript resource in HTML Component

I've uploaded a jQuery library document into our SF Shared Documents and want to be able to reference that document in a sidebar HTML component. I've tried many variations of the below with no luck: &...
Adam H.'s user avatar
  • 743
4 votes
0 answers
333 views

LWC: Building JS dependencies from NPM modules

To take advantage of NPM's audit, update, and other capabilities, I'm a firm believer that developers should use a package manager like NPM to manage JavaScript libraries that they import in their ...
Matthew Souther's user avatar
4 votes
0 answers
123 views

JSForce describeGlobal isn't working when the community has an added URL

I have to be able to get all objects on my salesforce community and whenever i utilize the jsforce library to get the connection by using this method "jsforce.Connection" let conn = new jsforce....
JPG's user avatar
  • 243
4 votes
1 answer
201 views

How to use polyfill in visualforce component?

Link to polyfill: https://github.com/jonstipe/number-polyfill The polyfill is to allow increment decrement buttons in Internet explorer for I added the .js and .css file from the polyfill as a ...
VChandra's user avatar
4 votes
0 answers
908 views

Jest Unit test an event that dispatches inside XMLHTTPRequest (XHR)

How do I test an event that does an XHR request and dispatches an event? I managed to install the dependencies to mock the xhr using https://github.com/jameslnewell/xhr-mock/tree/master/packages/xhr-...
Christopher's user avatar
4 votes
0 answers
1k 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 ...
Uwe Heim's user avatar
  • 28.3k
4 votes
0 answers
266 views

Is it possible to pass dynamically created attribute value from Lightning Component Helper to Lightning Tokens?

I would like to pass dynamically created attribute value from Lightning Component Helper to Lightning Tokens, and subsequently use the same in CSS. I'm trying to avoid using JavaScript to set style ...
SE_User's user avatar
  • 2,253
4 votes
0 answers
929 views

Add custom Javascript <script> tags to Napili and Lightning communities after Summer 17 release

After Summer 17 release the LockerService will disable Javascript tags in the community Header Markup and access to DOM from Lightning Components. If I would like to add a custom Javascript to Napili ...
rumdumdum's user avatar
  • 695
4 votes
0 answers
551 views

Uncaught TypeError: r[o].hasOwnProperty is not a function when trying to use a Static Resource

I'm currently working on a Lightning Component that needs a third party library when the library is loaded I get this error Uncaught TypeError: r[o].hasOwnProperty is not a function throws at /...
Nordine Hammache's user avatar
4 votes
0 answers
39 views

Is there any way to refresh dashboards on load as of Spring 16 release?

Is there any way to refresh dynamic dashboards on page load anymore? We used to be able to put in JS that "clicked" the refresh button for our users but that appears to be defunct as of Spring '16.
bcarlock's user avatar
  • 132
4 votes
0 answers
641 views

How to load Chatter with Javascript

Question How can I load chatter (chatter:feedWithFollowers) dynamically (using javascript) in the browser? Motivation I'm working on a Visualforce page that should load as fast as possible and the ...
Martin Borthiry's user avatar
4 votes
0 answers
541 views

OpenCTI Screen Pop only when window is in focus

We have an in-house OpenCTI adapter that we use with salesforce. It's primary responsibility is to find associated records and pop the results when a new call comes in. We have a tendency to have ...
YWCA Hello's user avatar
4 votes
0 answers
86 views

Including javascript in the top level window of Service Cloud

I'm working on an integration project that requires showing the Service Cloud from a .NET control. That control generally communicates via a javascript object on the top level window. The problem I'm ...
Josh Smeaton's user avatar
4 votes
0 answers
3k views

XLS Read and Automatic CSV conversion

We have a requirement to read contents (rows) from an XLS file and upload (the file as an attachment) the same once the read and insert into custom Objects are complete. My observation after ...
KaLi's user avatar
  • 1,519
3 votes
0 answers
768 views

LWC Native Modal + Issues with Overflow on Combobox

I am trying to swap out modals that were once pure LDS to the new native ones and I am having an issue with styling. My Modal Component: <template> <lightning-modal-header label="...
SBB's user avatar
  • 173
3 votes
0 answers
95 views

Formatting and color of values of objects logged in chrome devtools is unreadable in dark mode

After the Winter 23' release added Lightning Web Security I started having a problem viewing the values of JavaScript objects. Correct me if I'm wrong but to debug LWC in chrome devtools with LWS ...
Monakus's user avatar
  • 31
3 votes
0 answers
660 views

How to get unchecked value on lightning tree grid?

There is standard behavior on Lightning tree grid, where when we expand a parent, select a child, then collapse it, the child will be unselected. I am now able to keep the selected child value. ...
user2018's user avatar
  • 341
3 votes
0 answers
311 views

Implementing jstree library with Lightning Web Component

This will be a long one, hoping someone can help. Problem Summary: I'm unable to integrate the "Drag and Drop" (dnd) plugin functionality with my LWC that utilises the jstree library (https:/...
BenBates's user avatar
  • 201
3 votes
0 answers
284 views

Creating combo-box in LWC component

I have used a wire function to call function in Apex class, once data is received.I am creating array of object in format of [{label : 'label' , value : 'value' }] I used multiple approaches mentioned ...
Elijah's user avatar
  • 829
3 votes
0 answers
2k views

How to Target Element In Modal After Opening Modal

I have a custom modal component (with slots) that can be opened and closed. In a parent component I'm using this modal component and inside the body slot of the modal I have a <lightning-input> -...
jbyrd's user avatar
  • 641
3 votes
0 answers
336 views

What is a typical JavaScript code coverage for LWCs (Lightning Web Components) that are adequately tested via JEST?

I know this might get closed as being a matter of opinion, but as long as those opinions are based on actual experience, such answers are valuable to me, particularly if they are somewhat consistent. ...
Keith C's user avatar
  • 136k
3 votes
1 answer
485 views

SFCC - How show products from Stored Basket?

I have the situation: The Stored Basket (registered customer) is merging with the current Basket (anonymous customer), this is ok, but i need to highlight the products from Stored Basket to the ...
Lucasmoore's user avatar
3 votes
2 answers
11k views

LWC CSP script-src self error

I've been having this issue for the last 2 days or so. I have an lwc with its corresponding controller. the lwc contains a lightning-progress-indicator with a path type and has a onclick={...
Alexandros Barlas's user avatar
3 votes
0 answers
2k views

AuraError: Error at new Aura.externalLibraries

Background I am using this approach Call REST API from Lightning Components without Named Credentials to call the Salesforce REST API from a Lightning component. It works when I call this URL: /...
Robs's user avatar
  • 9,330
3 votes
0 answers
200 views

getReference databinding for maps

seems I have found a bug which prevents data binding in case of arrayed Maps. Maybe you can help me how to get around this. I have a list of Custom Objects, I iterate over. Each of the components, I ...
nico525's user avatar
  • 31
3 votes
1 answer
292 views

Unable to get screenshot of Rich Text Area Field which contains images using html2canvas library

Unable to get screenshot of Rich Text Area Field which contains images html2canvas Access to Image at xxx site from origin xxx site has been blocked by CORS policy: No 'Access-Control-Allow-...
RCS's user avatar
  • 2,110
3 votes
0 answers
571 views

Help on enableClickToDial in visualforce

I am using Open Cti in a visualforce page and the page is pinned in utility bar in LEX. Now on click of a button, we are invoking enableClickToDial with a simple callback. Howver the ...
Santanu Halder's user avatar
3 votes
0 answers
1k views

Cannot read property 'appendChild' of undefined

I want to show the geoposition on a leaflet map lightning component. I enter an Id and get geolocation data accordingly. When I first enter an Id everything works fine, for the second time it shows ...
Tokow's user avatar
  • 31
3 votes
1 answer
402 views

Salesforce1 - Reset history with force:navigateToComponent

I am currently working on an app created with lightning components. My app includes five different components, which I call with force:navigateToComponent from each other. I added a lightning tab ...
Chris's user avatar
  • 41
3 votes
0 answers
816 views

Displaying PDF content in new tab using ui:outputURL not working by clicking, But working by "Open link in new tab"

I have been trying to display PDF content in a new tab using ui:outputURL. It's not working by clicking, but working by "Open link in new tab". Component: <aura:application extends="force:slds" ...
Arun's user avatar
  • 498
3 votes
0 answers
2k views

URL.createObjectURL not working in lightning

This might relate to LockerService(Link). I try to use URL.createObjectURL on a vf page. Works fine in classic but in lightning it will give me "This page isn't available in Salesforce Lightning ...
user40660's user avatar
3 votes
0 answers
219 views

Ajax REST Tooling Queries Return Null SymbolTable?

Background I'm trying to build upon Daniel Peter's approach in his HyperBatch library to build a HyperQuery tool that will allow me to get better insight into some large tables we have without ...
Adrian Larson's user avatar
  • 150k
3 votes
0 answers
475 views

How to parse the matrix report data in to apex controller to show it in chart?

I am trying to pass the matrix type report into a google chart, but for that i need to parse the data.i have tried to do that but i didn't get any matrix grouping function since i am new to report ...
Sharma_raj's user avatar
3 votes
0 answers
332 views

Using Zapier Activity within Journey Builder

I´m triying to create a Zapier's custom activity within Journey Builder, but I´m having problems to show it in SFMC, pulling me the followin error: "One or more custom activities failed to load. ...
Jonatan's user avatar
  • 77
3 votes
0 answers
131 views

Service Console errors in javascript console

one of our customers is getting some errors in their DevTools Console after using the Service Console for certain period of time and I believe those errors are causing the DOM to break and cause ...
Emilio's user avatar
  • 362
3 votes
0 answers
2k views

ui:inputCheckbox and aura:iteration: value binding

I am currently writing a lightning component made of a table of elements that can be selected (or not) using a ui:inputCheckbox. So the way I do is fetching the data from APEX controller during the ...
Simonp's user avatar
  • 1,892

1
2 3 4 5
26