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.

0
votes
1answer
17 views

SFDX - Create Objects with Custom Properties

With the current state of the DX CLI, is it possible to dynamically add objects that have custom properties? Example - I create a scratch org then install the base package. From thereon, would I be ...
3
votes
1answer
2k views

How to check if the record is already part of the opened primary or secondary tab?

In the service console toolkit its not possible to open same record in two tabs since the tabs needs to be unique, reasons for which i understand. But i am in a scenario where in, on clicking a link ...
0
votes
1answer
25 views

Replace blanks with certain characters Using replaceAll() on javascript

var headers =['Test Text','Test Text Test']; for (var i= 0; i<headers.length;i++){ headers[i] = headers[i].replace(' ', '-'); console.log('header@@@@@@'+headers[i]); } this ...
0
votes
1answer
801 views

Lightning component immediate server action?

I have an application which depends on outbound calls to REST APIs to fetch data. Is there a way to enqueue and process actions right away? It seems like if I enqueue an action, it is not processed ...
0
votes
1answer
52 views

Lightning - OpenSubTab in Service console app

I am trying openSubTab on a service console application when user click on the member name. When I do so it giving error which i am not sure what I am doing wrong here. Could you please shed some ...
0
votes
0answers
9 views

Open Snap-In chat window on click of button

I have a custom button on click of which I need to open Snap-In window in my website. But I'm not sure which function to call to open the Snap IN window. <button type="button" onclick="initESW('...
0
votes
0answers
15 views

How to close the visual-force page opened as an iframe in the lighting view

I am calling a visualforce page on click of a button (URL type) as displayed below: On click of a button below page is opened. Now I am not able to Close this page to go back to the record page. I ...
0
votes
2answers
2k views

How to add an attachment in SalesForce using HTML input file and JavaScript?

I am trying to add attachments to an account through a Visualforce page using an HTML input file and JavaScript. Attachments are added using this page, but images are not shown in attachments. How to ...
0
votes
1answer
35 views

How to use Array.map() in Lightning Component JS File

I was going through this blog to understand foreach loop, but the blog says that use of Array.map() is more efficient than for foreach. So, I tried implementing that in my Lightning Component, but it ...
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
30 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
34 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
76 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
848 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
22 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
30 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
18 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
29 views

Not Accepting related Datatypes values [on hold]

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
17 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
17 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
32 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
633 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
850 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
21 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
939 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
21 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
362 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
701 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/...