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,032 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
847 views

Lightning component - Javascript function to fetch picklist values for multiple fields

I built a lightning component where multiple fields with type picklist needs to be shown in the UI. I added a javascript function to fetch the picklist values and also built a generic method where it ...
2
votes
1answer
878 views

liveagent.init callback function

I am trying to setup liveagent but am running into an issue with starting the chat. We have a form that the user enters information about themselves, and then a button to begin the chat. I use the ...
2
votes
0answers
216 views

Visualforce page is throwing error on Chrome for Spring 17 release

For a sandbox which has been upgraded with Spring 17 release, I am getting error (screenshot of the error message is mentioned below) from a Visualforce page which is embedded in the standard page ...
2
votes
0answers
651 views

Importing CSS & JS into portfolio and referencing them

I need to build email templates and have already been provided with the source code. I have encountered 2 issues: When I try to reference the CSS I have uploaded in the portfolio, SFMC doesnt seem to ...
2
votes
0answers
1k views

Base 64 Content in PDF

We are receiving a base64encoded string from apex webservices and we have to display that as pdf whenever user clicks on a button. currently we have the below code var isIE = false || !!document....
2
votes
0answers
142 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
142 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
3k 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
448 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
165 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
1answer
536 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' }); ...
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
93 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
31 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
76 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
589 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
318 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
134 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
72 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
363 views

Custom button on list view limitations

I have a custom button on my accounts list view to change the record from the current owner to my ownership using OnClick Javascript. I have admin privileges and when I use the button it succeeds in ...
2
votes
1answer
663 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
863 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
113 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
281 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
977 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
95 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
271 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
162 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
508 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
231 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
124 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
587 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
114 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

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
571 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
0answers
323 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
976 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
148 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
642 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
443 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
387 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
423 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
242 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
2answers
793 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 ...

1 2
3
4 5
21