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.

928 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
136 views

Using tab navigation causes function to fire multiple times in Lightning

I added the Build an Account Geolocation App Trailhead components to my home page in a Winter 17 org. I was getting an error with the leaflet map creation in the jsLoaded function so I moved the map ...
2
votes
0answers
132 views

Optimizing javascript on Lightning

(I am still new to Lightning so please forgive me if I'm using incorrect terminology.) I have a lightning application embedded into a VisualForce page. It has two separate components that each calls ...
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 ...
2
votes
0answers
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 ...
2
votes
0answers
387 views

Using onclick and ontouchend events in Lightning Components

I was going through the Lightning Componenet Developer Guide. I noted an interesting point which suggests not to use the onclick and the ontouchend events in the components under Events Anti-Patterns. ...
2
votes
0answers
162 views

Javascript warning when a lightning component is loaded

I developed a lightning application embedded in a visualforce page.This lightning app works very well. But since the Winter17', I've got the following javascript warning : WARNING: Access Check ...
2
votes
0answers
33 views

Google Charts works in Preview but does not work in Force.com Site

I am using Google Charts to display some data from a custom Object, it displays the data when previewed, but when I access it from a Force.com site I cannot view the chart. Additionally when I use a ...
2
votes
0answers
85 views

Access to the $A aura object inside a softphone

I'm trying to integrate my softphone (which uses the Lightning OpenCTI framework from api/38.0/lightning/opencti.js) with a home-made lightning component. I've got everything set up and the lightning ...
2
votes
0answers
30 views

Not Returning Records from Server Side Javascript Calls to DE

I have server side javascript code calling a DE and am experiencing 2 issues. I am not sure what I did incorrectly and appreciate any advice. Error with Call to DE: I believe that there may be an ...
2
votes
0answers
74 views

Javascript Button only works for my login in sandbox,for others it throws error

I have a weird issue in my sand box. I had wrote a javascript custom button to open a tab in primary tab.But the weird  thing is this code only works in my Login only,for others in the same sandbox it ...
2
votes
0answers
548 views

$A.createComponent throwing error when trying to create the same component for second time

I have to add and remove components from a Modal dialog - so using add code: $A.createComponent("pbrdev:TransactionViewer", { thistrans: ...
2
votes
1answer
277 views

Salesforce Javascript CORS rules

Is there a good summary of where from Salesforce allow and does not allow calling out to 3rd party REST API's (assume header Access-Control-Allow-Origin: *). Possible scenarios I can imagine: ...
2
votes
0answers
126 views

Salesforce Optimistic Record Locking and JavaScript Updates

Is there a way to implement field only updates for Salesforce? Even if fields could be updated concurrently through JavaScript/JavaScript remoting calls, would Salesforce still save the record using ...
2
votes
0answers
69 views

How to set a null value in a data extension field using javascript

I am trying to set null in a data extension field using server side java script, but it doesn't work. it is a date time field that goes to "monday, january 1 of 1900 00:00" every time I try do set it ...
2
votes
1answer
457 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 ...
2
votes
0answers
763 views

Javascript Error: Cannot read property 'Name' of undefined

CM_Contract__c is a custom object and Opportunity__c is a lookup field. I am getting the following error: Cannot read property 'Name' of undefined Here's my code: {!REQUIRESCRIPT("/soap/ajax/23.0/...
2
votes
0answers
111 views

AJAX Toolkit login method only creates a 500 Server Error

I'm including apex.js and connection.js (version 32) in some javascript on a preview sandbox running spring'16. I'm trying to use sforce.connection.login(username,passwordAndToken) Unfortunately I'...
2
votes
1answer
256 views

Javascript Input Selector

I currently have a character counter implemented on a visualforce page that includes a flow using this method. I would like to use this same method to count characters on a field in another ...
2
votes
0answers
891 views

oncomplete not working in visualforce page

I am trying to build a visualforce page which can work in salesforce and also salesforce1. I am trying to redirect after the action is completed it work just fine when i try it from desktop but from ...
2
votes
1answer
90 views

remoteObjectModel with Angular: Transform get() to dot notation

I have defined an <apex:remoteObjectModel> in my .page file and can access custom objects through new SObjectModel.ObjectName().retrieve(). However, the fields in these objects are accessed as ...
2
votes
2answers
257 views

JQuery: checkboxes wrapped in apex:repeat

I would like it so that when someone clicks on a '.propertyRateTable' element, ONLY the checkbox next to it becomes checked (See image for reference). The code below simply checks every checkbox (As ...
2
votes
1answer
158 views

Salesforce Lightning - wheelnav.js question

I'm trying to use the wheelnav.js library to create a wheel navigation in my lightning component. For some reason when the wheel renders, the wheel will not render correctly.. The size the wheel ...
2
votes
0answers
493 views

ng-bind-html doesn't work with CaseComponent.CommentBody

Could anyone please help me figure out why ng-bind-html doesn't work with CaseComponents.CommentBody? <table class="table table-hover"> <thead> <tr> <th&...
2
votes
1answer
208 views

Field update Onclick Javascript not showing on record

I am trying to update a field on a record using an OnClick Javascript button. It seems to be updating the record but when I refresh the page nothing shows. What am I doing wrong? Below is my code: {!...
2
votes
0answers
114 views

encapsulate all the function needed on the OnComplete of an ActionFunction to one function

Calling multiple functions inside a function and call that on the oncomplete attribute of an ActionFunction is a bad practice, just heard this from my team. I was looking for a source that will ...
2
votes
0answers
42 views

dependent picklist on vf page using apex:selectoption in force.com site

We have a force.com Sites application for our customer portal, on one particular Visualforce page we have a set of dependent picklists displayed but we can't use apex:inputfield. so need to use select ...
2
votes
0answers
544 views

JSForce Login Issue

I am using Jforce to connect to my developer account using oAuth. But i am getting error. This XML file does not appear to have any style information associated with it. The document tree is shown ...
2
votes
0answers
103 views

visualforce apex tag JS error when selecting picklist

Anyone have already encounter this issue? Error will occur if you select the any of the picklist. Any other way to fix the issue? VisualForce Page <apex:page showheader="false" sidebar="false" ...
2
votes
0answers
54 views

Javascript, Forms, and Describe

One of the advantages of using Visualforce is the magic that happens when building forms. When you use an <apex:inputField> component (particularly when in an <apex:pageBlockSection>, ...
2
votes
0answers
1k views

Retrieve shared data extension column names with SSJS marketing cloud

I am trying to retrieve the column names from a shared data extension in the Marketing Cloud. I am using the follow code. This code is working with data extensions which are not in the shared items ...
2
votes
0answers
1k views

Upload an Attachment/Document through REST API

I am following these instructions, but I keep getting the error [{"message":"MediaType of ''multipart/form-data' is not supported by this resource","errorCode":"UNSUPPORTED_MEDIA_TYPE"}] Any idea ...
2
votes
0answers
560 views

Javascript SOAP API external access

I am trying to call our Salesforce SOAP API from an external server using JavaScript, but I am getting an error because the URL it is using is from my localhost server. I am getting this error: ...
2
votes
1answer
595 views

JSON for Autocomplete functionality in VF

I'm trying to get my autocomplete functionality to work in my VF page for a TextField. I need to obtain the List of a custom Object from my controller (with the name and the ID of the record). I use ...
2
votes
0answers
309 views

Draw on Google Map within Visualforce

I'm wanting to be able to free-form draw on top of a map within a Salesforce page if possible. I believe this can be done but am having a hard time getting the code to work. Any help is appreciated. ...
2
votes
2answers
915 views

DatePicker Issue

I have two text field: One normal text field that accepts numbers. <apex:inputField value="{!FinancialAssCont.Down_Payment__c}" styleClass="form-control downpaymentAmount" onblur="...
2
votes
0answers
140 views

backbone.js in Salesforce1

I am starting to build some mobile samples in Salesforce1 using backbone.js I came across two js libraries - Backbone.Force https://github.com/pwalczyszyn/Backbone.Force this extends backbone.js ...
2
votes
0answers
613 views

Get print of visualforce page containing different charts

I am creating a dynamic dashboard using Vf Charts. I am having about 18 different charts on a single visual force page. I have added a print button on the visualforce page to print all the charts on ...
2
votes
0answers
172 views

VisualForce alternatives? What are people using for BIG projects?

Are people using VF for large, complex front ends? or are people primarily using other front end frameworks and just hitting Force.com for backend data storage, authentication, etc?
2
votes
0answers
2k views

Javascript Error : “cannot read property of Id undefined”

I have a custom button which is using the javascript code given below. I am getting the error that it is not able to get the Id. Please suggest where am in going wrong. "cannot read property of Id ...
2
votes
0answers
441 views

Dependent Picklists - Javascript callback

Situation Dependent Picklist fields are implemented in SFDC using a JS file called "Picklist.js". This script seems responsible for adding or removing <select> tags in visualforce pages. ...
2
votes
0answers
357 views

Error Generating Quote PDF

I am trying to generate QuotePDF on click of a JS button. I have not created any VF Page for the PDF and am trying to use the standard functionality. My code to generate PDF is:- PageReference pr = ...
2
votes
0answers
382 views

How can we re-size the attachmant file in salesforce

I am working on salesforce1 app where I have a apex:inputfile tag, on which I have added attribute capture, for capture image using mobile camera (capture=camera). This is working fine with both ...
2
votes
0answers
239 views

Javascript not supported in SAP WebdynPro or WebGUI. How can a canvas app subscribe in that situation?

I am in a position trying to submit a Canvas POC to the client. But the issue is Javascript not supported in SAP WebdynPro or WebGUI. How to subscribe to visualforce events from canvas events in that ...
2
votes
0answers
273 views

Show The first field value based on 2nd field value dynamically?

I have create a page which has picklist based on that picklist i have to show the rows and in that rows i have toshow 1st row value based on 2nd valu means level low days high ...
2
votes
0answers
3k views

Adding SSJS Script Activity to ExactTarget Automation Studio

we need to do the following and I'm rather lost of where to begin, so I was hoping someone could point me in the right direction. We need to create an SSJS Script Activity to Automation Studio (this ...
2
votes
2answers
723 views

Print only a single tab on a tabbed VF page

I have created four apex tabs in a vf page. In that page,I'm using print functionality for the particular div section.Its works fine when i click the print button for the first time.But when i click ...
2
votes
0answers
976 views

Print Functionality in Salesforce1 Mobile App

I am trying to do the print option in the Salesforce1 Mobile app. I have tried two methods of printing, one is a Javascript method and the other I've tried using is the canvas method. But both methods ...
2
votes
1answer
262 views

qtip content filtered with a condition

This is my Code: $(document).ready(function() { var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); $('#calendarx').fullCalendar({ ...
2
votes
0answers
598 views

Apex:ActionFunction and getContent

I have a two pages that share the same controller extension. The first page gathers some information for a record, builds a PDF from the second page and attaches it to the case. I have a lot of ...
2
votes
0answers
700 views

Issues for Signature pad in popup Window

I have created a VF Tab in this tab have a custom button "Sign", when i click on the button it will show popup window and I get the signature from customer and save it as an attachment in Account.When ...