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.

1
vote
0answers
22 views

Access apex variables from non visualforce markup

I want to execute some javascript in a Visualforce page: function newWasteAssessment(){ var siteid = '{!siteID}'; console.log('new waste assess: '+siteid); if(sforce....
1
vote
1answer
23 views

How to get custom field returned by Platform Event in Lightning Aura Component

I haven't been able to figure out how to access a Custom Field on a Platform Event within an Aura Component js callback handler, does anyone know how I can do this, or where it exists in the ...
1
vote
2answers
31 views

“Cannot destructure property” on LWC

I'm attempting to create a component that gets the current record's Id and queries related records that contain a Geolocation field, so I can populate a map. While developing this, I created a method ...
0
votes
2answers
2k views

Open in new Tab click

I am using this below code to record how many times an user is clicking a link i.e onclick i am calling an action:function and it is working fine. But the user is doing open link in new tab. When he ...
0
votes
1answer
1k views

How to customise live chat javascript code to use single html element

The standard live agent chat button code uses 2 html elements, how could it be re-structured to use just a single element and use css to show/hide the button when it is an online state? The reason for ...
1
vote
1answer
67 views

Unable to get values of selected elements in lwc js controller [on hold]

I'm developing a Lightning Web Component, which has the add & delete row functionality. Each row contains 1 input text & 2 picklists. I want to capture the value of all the rows i.e input ...
1
vote
1answer
23 views

Unable to use variable of javascript remote method variable in chart.js code. It is coming as undefined

I have to use list of accounts as labels in my chart. In order to fetch list of records I have used js remoting. I am able to fetch but not use within chart.js labels. Here goes my vfp :- <...
0
votes
1answer
844 views

Enable button when checkbox is selected

I have visualforce page that renders the data in apex:pageBlockTable I have checkbox with button, I'm trying to acheive the following: When the page loads I want the button to be disabled If the ...
0
votes
0answers
18 views

Javascript on rerendered outputpanel not working in production

I am using an action function to rerender an output panel in my visualforce page after i fetch some data from the controller, and then i manipulate it with some javascript (also inside the same output ...
0
votes
2answers
664 views

get value from the look up object on change of look up field

My requirement is like below. I have two objects Student and Sports. ** Student ** Name SportActiviy SportDescription etc... **Sports** SportName SportDescription In Student creation page, I have ...
0
votes
2answers
40 views

Dynamically set columns on pageBlocksection and pageBlockSectionItem?

Page : <apex:page id="ContactDetails" extensions="ContactsController" standardController="Case"> <script> function showFieldsOnClickAction() { showFieldsAction();...
1
vote
1answer
29 views

Unable to setup custom javascript detail page button

I am working on detail javascript button in the lead object. But now I am facing the below issue. Javascript code: {!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/24.0/...
0
votes
0answers
16 views

Copying fields data when checkbox is checked in multiple rows(Visualforce Page)

I have challenge I'm working on a visualforce page I want whenever the checkbox is checked I want to copy the values into input text fields in visualforce page. So here I have multiple rows and ...
-1
votes
0answers
28 views

Not Accepting related Datatypes values

Hi I am building Custom filter logic by using Lightning component.I have created apex class,JS file and lightning component for this. But The problem is field value is accepting only string value. ...
5
votes
1answer
453 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....
1
vote
2answers
8k views

Uncaught DOMException: Blocked a frame with origin “https://c.ap2.visual.force.com” error

I am trying to access the home page from a custom home page component, i.e. of type VF area, through JavaScript but I'm getting Uncaught DOMException: Blocked a frame with origin "https://c.ap2....
0
votes
0answers
16 views

How to validate the <apex:inputfields> on form submission and show error using SLDS?

I am using SLDS in a VF Page and I am referring to this link here to show error. The problem is the error is displayed on page load because I am not removing the Slds-has-error class. But, how do I ...
1
vote
1answer
808 views

Javascript error on Button click

I am using one custom list button on one of the related list. But sometime when I click on this button I am getting the below error message: A problem with the OnClick javascript for this button or ...
0
votes
1answer
28 views

How to get value of input from lightning js controller without an id

I am creating the form using: <lightning:recordForm aura:id="data-export-form" objectApiName="{!v.sObjectName}" fields="Account__c" columns="1" mode="edit" onsubmit="{!c....
0
votes
1answer
15 views

How to edit a specific row/index in aura iteration by javascript?

Hi I am trying to edit a specific row in an iteration based on an onchange event. One of my columns in my iteration is a picklist. And depending on what is selected I want the rest of the columns in ...
0
votes
1answer
31 views

visualforce list of available javascript libraries? [closed]

This is me frustrated with getting wrong search results... I'm looking for any salesforce based javascript files or libraries available for use in visualforce pages. I've come across a few in the ...
11
votes
4answers
617 views

Lightning Framework vs Standard Client Side Frameworks (i.e. React) // Which to chose when, and why?

Disclaimer Keep it objective! This one can get a little opinionated, please try to keep your answer specific to the facts a developer should be considering when choosing between two viable options ...
0
votes
2answers
843 views

Download file(Image/Doc/PDF) in Lightning component

I have an url of the image(Not from salesforce) which is stored in another system. Can i download that file by providing link to the URL in my Lightning component ? I have tried with "**lightning:...
1
vote
2answers
2k views

Retrieve All Subscriber Status

I am working on a custom profile center and I'm using server side javascript to extract information about the lists a subscriber is currently subscribed to. When I use the lists.retrieve function it ...
0
votes
1answer
22 views

Uncaught Error: Mismatched anonymous define() module. When using RequireJS in a Visualforce page

Background RequireJS is a dependancy for another package I want to use in a Visualforce page. I have uploaded RequireJS as a static resource. <apex:page showHeader="false" standardStylesheets="...
1
vote
0answers
20 views

How to print iframe in Lightning Component

I have a Lightning component which has an iframe to a visualforce page: <aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId"> <iframe aura:id="myFrame" ...
0
votes
0answers
25 views

Interacting with external calendar library in my Lightning component

I am implementing FullCalendar in a lightning component and am having trouble interacting with it from my methods. When I click on the Previous button, the console log appears but doesn't navigate to ...
0
votes
2answers
59 views

Lightning components parameters passing

can we pass parameters like json objects,json,strings, integers among helper methods in lightning components? I am trying to pass ( Helper1:function(){ Var Parameter1s = jsonobject; ...
0
votes
2answers
927 views

lightning:input time display

I am using a <lightning:input type="time"/> component and the picker is displayed to the user in 12 hour time with an AM/PM picker. I want to display this value to the user in a table and the ...
0
votes
1answer
26 views

Add Visualforce Page that is just a Button to the Custom Buttons Section of Page Layout

I had a custom button that used OnClick JavaScript behavior and when it was clicked would execute a bunch of JavaScript which would ultimately build a url and open it in a new window for the user. ...
-1
votes
0answers
20 views

Scan Barcode from computer webcam and mobile camera [duplicate]

I want to know if there are any html5 and javascript api available to scan barcode from camera. I do not want to build a native app. The web app should be able to open pc camera and scan barcode ...
5
votes
2answers
452 views

Javascript remoting for Apex

Can somebody please explain what security measures are in place for Javascript Remoting? Specifically, what safeguards are there against cross-domain requests and users trying to interact with @...
0
votes
1answer
20 views

Window.local message should be retained even if the window is maximized

In the softphone layout for the CTI integration I am sending the data from visualforce page to other page by using window.local storage. I am able to send the data. But the layout has a maximize ...
0
votes
1answer
359 views

getParam Not Working on Simple Application Event

I have a button which when pressed causes an application event to fire. Before it does this it sets a string value using setParam. The event is fired and handled successfully. However, when I try to ...
0
votes
2answers
19 views

Need to get the key of an Object Array given a Value

I have a registration process that differs from each record type, I need to get the recordType Name (or label in this case) so I can give proper flow to each user. The record type selection is made ...
0
votes
1answer
16 views

How Do I Use The “oncomplete” Function To Refresh A Different Visualforce Page?

Is it possible to update a different visualforce page using the "oncomplete" function? I have a visualforce page that I would like to have the ability to refresh various other Visualforce pages when ...
0
votes
1answer
10 views

Trigger change in PickList4.js from Salesforce

How can I trigger a picklist change event inside salesforce: We have the following code : <apex:outputPanel id="dynamicRerender"> <apex:repeat value="{!strings}" var="...
1
vote
4answers
1k views

Clicking button should reload the page and the callout must be performed asynchronously

My question is, should clicking a button reload a page and perform an asynchronous callout? It looks like its reloading the page after finishing the callout. Custom Button : Execute JavaScript {!...
0
votes
0answers
7 views

Salesforce 1 - Capture Location

I've come across a requirement where User's location needs to be captured at every 1 minute (Without any user intervention). Application - Salesforce1 Is there any way by which we can achieve this? ...
2
votes
2answers
685 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
vote
2answers
695 views

Connect to WebSocket From Visualforce Page

Below is my code - <apex:page docType="html-5.0" showHeader="false" sidebar="false"> <html> <head> <script type="text/javascript" src="http://cs8.salesforce.com/...
1
vote
2answers
43 views

How to use “jsforce” in an external HTML client for streaming api?

I am trying to use streaming API feature of salesforce, and be able to subscribe to the topic in an external client which is HTML based. My code is below: <html> <head> <...
1
vote
1answer
18 views

Open Html file from Heroku Bash

I have deployed my Flask python application on Heroku. The problem is that in one line of my python code I must open an HTML file (where some javascript gets executed). Obviously, it locally works in ...
0
votes
0answers
14 views

Dependent picklist not working when rendered in output panel of VisualForce Page

This is a small snippet of a bigger scenario. Here I have an empty div where I dump the full div section of the reRendered output panel. I am doing this so, because in my main codebase we have a ...
0
votes
1answer
31 views

Use force:navigateToURL to open new window instead of new tab

When I use force:navigateToURL, it opens the URL in a new tab. Is there anyway to force this to open in a new browser window instead? Thanks in advance, code pictured below var urlEvent = $A.get("e....
0
votes
3answers
876 views

DocuSign Custom Button

I am fighting with a javascript custom button, I would like to add the behavior to auto populate automatically over the DocuSign envelope the documents. I'm not able to find a way to make this work ...
2
votes
1answer
110 views

window.postMessage does not work in lightning console app. Any workaround?

We have an flexipage/app which have 5 lightning components on it. Out of these 5, 3 are lightning component and 2 are visual force pages embedded inside lightning component. I went through https://...
0
votes
0answers
17 views

How to stream the barcode using input type file with out click capture button [duplicate]

How to stream the barcode using input type file with out click capture button. my requirement is Need to stream the barcode and get the barcode value with out clicking capturing button.once input file ...
0
votes
0answers
16 views

How to auto scan Barcode in SF1 app without clicking image [duplicate]

We have a requirement to decode Barcode of Product in salesforce1 camera and store the decoded barcode value in a custom field on Product. where I want to auto scan Barcode from SF1 App camera ...
0
votes
0answers
14 views

Javascript Code on Order Object in Create Order Custom Button

I want to override Standard Button with Custom Functionality. When user clicks Create Order button it should check for its related Quote's Quote lines product name which contains QSM then it should ...