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.

888 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
13
votes
1answer
567 views

Lightning Components: Why is the rendering of 3-level nested <aura:iteration>'s so slow?

I have been working with a nested iteration and it is causing a delay of >3 seconds AFTER loading things from the APEX controller. The APEX response itself is fast, so I'm not looking for any APEX ...
10
votes
1answer
611 views

JS Synchronous Calls - Email with Attachment

I'm trying to set up a JS button on a SFDC object record that sends an email to a recipient with a specific attachment from the Notes and Attachment related object. Would I theoretically be able to ...
6
votes
0answers
977 views

'Script Error' in my Lightning Component?

I have a component: <aura:component controller="FileUploadController"> <ltng:require styles="{!join(',', $Resource.DropZone + '/basic.min.css', $...
6
votes
1answer
93 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 ...
6
votes
1answer
2k views

Un-hide and focus an element in a Lightning component

I want to show an input element that is hidden, and focus it. Component code: <aura:component > <div> <input aura:id="input" class="hidden"/> <button onclick=...
5
votes
0answers
372 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 ...
5
votes
0answers
273 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, ...
5
votes
1answer
1k views

Programatically add focus on ui:inputText

I'm afraid I'm hitting a limit of Lightning here, but I'd thought I ask here as a last resort. I want to programmatically add focus on a field in a form. I now have code like this; Markup: <ui:...
5
votes
1answer
473 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....
5
votes
1answer
195 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 ...
5
votes
0answers
567 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() { ...
5
votes
1answer
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: &...
5
votes
2answers
158 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 --> <...
4
votes
1answer
350 views

Stripe integration for Salesforce in lightning components

We are trying to implement Stripe integration with Salesforce by using Lightning Components for payments. Stripe use an API for securely obtain the users card information. This API is for the client,...
4
votes
0answers
534 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 ...
4
votes
0answers
327 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 /...
4
votes
0answers
35 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.
4
votes
0answers
338 views

Does anyone know a good snippet collection for APEX, Lightning and SF-specific JS?

I'm improving our free IDE CodeFusion and just added configurable snippet support in the new version. Internally we are using ACE Editor. Now technically I'm already done and it works like a charm. ...
4
votes
0answers
503 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 ...
4
votes
0answers
341 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 ...
4
votes
0answers
74 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 ...
3
votes
0answers
64 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 ...
3
votes
0answers
85 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: /...
3
votes
0answers
601 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={...
3
votes
0answers
126 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 ...
3
votes
2answers
234 views

Component.set is slow with a large array of objects

I am developing a lightning component. In this component there is an attribute called allItems that contains an array of objects. Currently tested holding up to 600 objects. However when I call a ...
3
votes
0answers
183 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 ...
3
votes
0answers
171 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 ...
3
votes
0answers
32 views

How to validate the specific record when field is empty based upon specific record value in apex:repeat tag?

How can I validate the specific record when field is empty based upon specific record value in apex:repeat tag? For example, I have displayed 10 account input records with four fields in page. In ...
3
votes
0answers
507 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" ...
3
votes
0answers
2k views

download the salesforce lightning component content into a pdf

I have an issue in salesforce lightning that how can I convert the following Salesforce lightning component into PDF. We have working on something that we are able to convert the HTML page into PDF ...
3
votes
0answers
118 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 ...
3
votes
0answers
223 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 ...
3
votes
0answers
233 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. ...
3
votes
0answers
89 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 ...
3
votes
0answers
524 views

How to make table align correctly Salesforce Lightning design system Javascript Table

I was able to append my data, and now the data does not align correctly with the column headers as well as it is not sortable (in the code I have sortable enabled. and the check boxes do not align ...
3
votes
0answers
357 views

jqGrid issue after enabling lockerservice

We have a lightning component that uses jQuery2.2.4 and jqGrid 5.1.1. After enabling lockerservice this component stopped working. We have come up with a simple test case to reproduce the error. App ...
3
votes
0answers
85 views

View all console events

I'm new to Salesforce. I have a CTI integration that needs to fire some events via sforce.console.fireEvent. Is there a tool or some setting I can turn up in the developer console to observe the ...
3
votes
1answer
543 views

URL Whitelisting in Salesforce Console

In the Salesforce console, we have an user action that will open the Email tab using the Email Url. For example: ui/core/email/author/EmailAuthor?p3_lkid=001E000000CVCF7&retURL=%...
3
votes
0answers
265 views

How to get the Referrer in SF One

I have a bit of a pickle. I have overloaded my custom object's view page with a VF page. This means that it can be invoked, using native functionality, from all kinds of places (search, related lists, ...
3
votes
0answers
133 views

Salesforce global JS objects

Can anybody help me to find official description or any other information about global SalesForce JavaScript objects (not Visualforce global variables)? I know that there are exists some JS objects ...
3
votes
0answers
712 views

Javascript custom button stopped working, Synchronous XMLHttpRequest is deprecated

We have a custom javascript button on the quotes object in our org that has been working for several months that someone has noticed today is not working. I'm not sure if there was an update that ...
3
votes
0answers
1k views

Problems authenticating using JSForce

so I've been trying to use JSForce to authenticate into SF. I used both the first example with SOAP API login and the second one with OAuth2: https://jsforce.github.io/document/#connection However, I ...
3
votes
0answers
117 views

I can't patch a salesforce object using angular and REST api

I'm trying to patch a salesforce object using angular, but am getting no where. Every time I get a nondescript error. salesforce.patch = function(resource, contentType, data) { var http = angular....
3
votes
0answers
556 views

How can decompress gzip file in salesforce

I am doing SF integration With Power Bill. In the response i am getting a gzip file with encoding-format: application/x-gzip. I want to decompress this file into Sf but not able to find any solution. ...
3
votes
0answers
253 views

AJAX Toolkit execute Apex method with inner classes

I have a Visualforce Page where I use the AJAX Toolkit to execute Apex methods. In my Apex Class I have this POC method: WebService static ParametersWrapper testWebserviceMethod(ParametersWrapper ...
3
votes
1answer
569 views

JSForce - getting OAUTH2 refreshToken - variable app is not defined

I am clearly missing something called app here. I am following Authorization Request section from the documentation. It says your app is callbacked from Salesforce with authorization code in URL ...
3
votes
1answer
236 views

Is it possible to include js files from static resources into listview onclick JS button?

Is it possible to include js files from static resources into listview onclick JS button? REQUIRESCRIPT can't be used anymore for static resources because of this Known Issue that won't be fixed. The ...
3
votes
0answers
410 views

Is it possible to include a Mustache.js Template saved to a Static Resource within a VisualForce Page?

My VisualForce page includes the following Mustache.js template code: <script id="template" type="x-tmpl-mustache"> <tr><td>{{LastName}}</td><td>{{FirstName}}</td&...
3
votes
1answer
460 views

Javascript in custom button

I created a custom button with the send email features, so if the margin<0.4) show alert, than can't send the email. I created the button but it doesn't work. Somebody can help me? {!...