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.

930 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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 ...
2
votes
0answers
317 views

Get Current User Contacts via Ajax Request

Is there a way of fetch a current user's contact information from a canvas app via an ajax (javascript) request? Thanks.
2
votes
0answers
272 views

Fetch more and append records using Data Repeater and pagination Site.com

I want to fetch more records and display the previous records along with newly fetched records using pagination. But the default behavior of pagination is to override previous with new one. Is there ...
2
votes
0answers
269 views

Winter 14 causing errors?

I have a very simple VF Page, that just has an action method that copies the address of the head of household to all the rest of the contacts to the household. This has worked fine, but on Saturday ...
2
votes
0answers
456 views

error message on page close

I have a Visualforce Page that will show an error message if a user tries to exit page without hitting one of the command buttons. It shouldn't trigger if the user clicks on the command buttons. This ...
2
votes
0answers
32 views

Anyway to hack subscriber users to a piece of content?

Is there any supported or unsupported way to programmatically subscribe a user to a piece of content? A related post suggests that you might be able to hack a post to make a piece of content as ...
2
votes
1answer
601 views

JavaScript to determine Salesforce1 location (native app or mobile browser)

I've found that I need some different behaviors based on whether the user is visiting my VisualForce page via the Salesforce1 native app (iOS or Android) or is using a mobile browser on the /one/one....
1
vote
1answer
29 views

Component event not being caught

It looks like the event is firing but the handler is not catching it. How do I go about getting this component event to be handled? EVENT: <aura:event type="COMPONENT" ></aura:event> ...
1
vote
0answers
14 views

Question on URLFOR SPACE

I am using a URLFOR function in the URL field. When i am entering 'X Y' for the query string parameter, the output of the URL is https://www.google.com?X+Y=777 instead of https://www.google.com?X%20Y=...
1
vote
0answers
27 views

Modal being rendered in wrong position on lightning web component's mobile page

What I want I'm trying to show a modal to warn the user when the service he is trying to reach is offline. This salesforce page is accessed by Salesforce1 through a tablet. How I did I've created a ...
1
vote
1answer
56 views

LWC Modal Losing Focus

Update 10/25 I have a modal that I am creating when a user clicks on a lighting card. For accessibility reason I need the focus to remain in the modal until the user clicks Dismiss or hits the ...
1
vote
0answers
36 views

How to use polyfill in visualforce component?

Link to polyfill: https://github.com/jonstipe/number-polyfill The polyfill is to allow increment decrement buttons in Internet explorer for I added the .js and .css file from the polyfill as a ...
1
vote
1answer
93 views

LWC - Object OpportunityLineItemSchedule is not supported in UI API

I've created a button on opportunity page using LWC. Once the button is clicked it should create OpportunityLineItemSchedule records based on Opportunity and related OpportunityLineItem record. ...
1
vote
0answers
52 views

force:recordData simpleRecord returning null

Component <aura:component implements="force:lightningQuickActionWithoutHeader,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" > <aura:...
1
vote
1answer
44 views

4 Level Picklist Dependency

I'm trying to set up 4 picklist that are dependent on each other. The idea is this: There are 4 different picklist. Pick1, Pick2, Pick3, Pick4 Pick2 is dependent on Pick1. Pick3 isn't necessarily ...
1
vote
1answer
45 views

How to change the value of a input field on select

I am trying to update the selected value from pop up to the input fields. But the value is not getting reflected on UI. If any one have any idea please help below is my code HTML <template> &...
1
vote
0answers
92 views

How to use LWC in markup that is dynamically created by third party libraries?

I'm using Leaflet, a third party mapping library. Leaflet dynamically creates tooltips for each map feature. You can write custom HTML for these tooltips, but I want to use a LWC component there. Here'...
1
vote
1answer
55 views

convert this javascript code to work in lightning

The Sales representatives in my company can log into an user profile by clicking on a custom link in SF classic which is an on click java script and when clicked on that link the representative is ...
1
vote
0answers
19 views

Customise Standard lightning Component from custom lightning component

I have a custom feed filter visualforce page created with the help of this link. And then I added the vf page in lightning component with iframe and in case page layout. After the page is loded main-...
1
vote
0answers
47 views

XPath in lightning Javascript

I have an XPATh expression which i want to use in my lightning javascript file. I tried several examples but i have been unlucky. Can someone tell me how do i get a reference of the dom using xpath ...
1
vote
2answers
222 views

Trying to trigger an automation from different Business unit using SSJS Activity

I have written the below code and created one test scheduled automation to start the automation. I didn't get any error when i did scheduled/publish the code but my automation is not starting. and i ...
1
vote
0answers
30 views

Orderitems Javascript Button replacement for Lightning

Currently I have the following as a javascript list button that allows the user to selected records: {!REQUIRESCRIPT('/soap/ajax/29.0/connection.js')} var selectedRecords = {!GETRECORDIDS( $...
1
vote
0answers
101 views

SSJS script activity not updating Query Definition as expected

I am trying to update a query definition in Marketing cloud using SSJS script which updates the query based on the datestamp. When I run the script, I don't get any error but it does not seem to be ...
1
vote
0answers
163 views

DOM Exception JSON.stringify - Error in Console

Updates: ----Latest Update---- I am able to convert the event to a string with dojox and their serializer that allows circular objects to be stringified. I originally tried to include dojox via a ...
1
vote
0answers
16 views

Capture Browser Click Events from Console Component

I am trying to capture all clicks in the salesforce classic console from a script in a custom console component. The following javascript logs all onclick events in the console in the frame of that ...
1
vote
0answers
44 views

Multiple filters for same field in wave:update

I'm developing a Salesforce Aura component that updates an existing Wave Analytics dashboard whenever something changes within the component. Those changes may affect same field with several values ...
1
vote
0answers
175 views

SSJS - Read a Data Extension after an Rows.Update

i'm now in my firsts baby steps in JavaScript on Salesforce Marketing Cloud. In my script i read one Data Extension with an DataExtension.Init("DE") and a DE.Rows.Retrieve(filter). After this, some ...
1
vote
0answers
32 views

Apex param or Action Function doesn't work

I would like to get param in Visualforce page. But, I can't get. 1.User input text, and click button in Visualforce page.  User add rows to input text.(I used javascript) 2.In next page, we want to ...
1
vote
1answer
758 views

How to refresh contents of modal on button click? (VF Page)

I'm using a modal that has as input fields object fields linked to the controller. After filling the modal I send the "experience" to the controller and save it and send back an empty singlExp so that ...
1
vote
3answers
207 views

Aura iteration does not update the View after array Update?

My lightning component's controller has an array named newResources and using aura:iteration to show a table based on the values in it. There is a method in js "removeNewResourceColumn" which removes ...
1
vote
0answers
98 views

VSCode is checking my static resource JS files as if they are LWC

I have some JS files in a static resource. I pulled code from a Production org and converted to DX format for convenience. I am noticing when I open them in VSCode I get errors like "LWC1007: c:\foo\...
1
vote
0answers
43 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 ...
1
vote
0answers
23 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
52 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 ...
1
vote
0answers
96 views

smart capture javascript validation

I tried to do validation using Javascript on smart capture. When I submit the form it does not seem that the function is running. My code: Form tag: <form id="myId" class="smartcapture-content-...
1
vote
1answer
164 views

Open parent and child records as primary tab and sub tab in console at the same time

I am trying to open a primary tab and subtab in the console app after user clicks button on visualforce page in custom console component. The subtab would be the opportunity entered in the input field ...
1
vote
1answer
113 views

Promise function in WireMethod not working properly

I am writing this wire method that when the data is loaded, it will trigger off a refresh of some other wire methods dependent on the results of this wire method. I do this by using a Promise and ...
1
vote
0answers
35 views

Visualforce Page Force.com Site - Language Translation By Clicking on a “Change lang Button”

I have a force.com site which I would like to translate the fields name of a form when a button was clicked. What I did so far: I created a basic form I activated the Spanish translation and ...
1
vote
0answers
371 views

Add addEventListener for blur to lightning:inputField

I want to invoke a method when inputfield is off from focus state(blur). I am trying as below but i am not able to get the alert statement when the cursor is out of focus from field . Can some one ...
1
vote
0answers
317 views

Maximum call stack size exceeded when trying to set an Attribute in lightning component

Hi I have been getting a weird error when trying to set an attribute in the lightning component. This attribute has been pass to the child component from its parent. The attribute that I am trying to ...
1
vote
0answers
191 views

Get event source from onclick handler in outer div

In my lightning components, I am trying to create a system that keeps track of every button that gets clicked inside my component. Having an event that fires whenever any button is clicked turns out ...
1
vote
0answers
130 views

onclick event not working for th tag

I'm able to successfully do onclick events in my component, except when I try it on <th>. Why doesn't it work? I'm trying to do an onclick event on the <th> to do sorting of the table data....
1
vote
0answers
85 views

Alternative to lightning:overlayLibrary in LightningOut

I have a Visualforce page which loads a Lightning Aura Component using LightningOut. The Lightning component uses a <lightning:overlayLibrary component, which is not supported in LightningOut. ...
1
vote
0answers
238 views

Send data from Lightning component to visualforce page without window.postmessage

I am using window.postmessage() to send data from lightning component to visualforce page as given in below link. https://developer.salesforce.com/blogs/developer-relations/2017/01/lightning-...
1
vote
0answers
168 views

Marketing Cloud SmartCapture javascript validation

I am trying to add field validation with Javascript on a SmartCapture form. The field validation is working, however I get POST 500 (Internal Server Error). For some reason, the post method breaks ...
1
vote
0answers
166 views

Adjsting the height of component dynamically

I have two child component A and B inside a parent component stacked one after other.Component A is supposed to be static and does not contains scroll bar.How ever its height changes depends on ...
1
vote
1answer
45 views

How to fetch geotag of already stored document (document is an image)

Scenario - Image is captured and uploaded (the image could be used for multiple purpose) In one scenario this image uploaded consist of geotagging is to be identified As per my understanding EXIF ...
1
vote
0answers
18 views

Inconsistent behaviour with ui:inputRadio when state changed externally

Background I have some images img and radio options ui:inputRadio <img alt="visa" onclick="{!c.handleCreditCardLogoClick }" src="{!$Resource.cclogos + '/logo-download-centre_visa.png'}" /> &...
1
vote
0answers
32 views

Userscripts manipulating aura components

Objective: To write a userscript that runs on my browser and scrapes data from a specific salesforce dynamic form that I have to fill out during my job. Summary: I am using TamperMonkey to run my ...
1
vote
0answers
596 views

Lightning button attribute “Disabled” in “aura:iteration tag”

I'm trying to enable a lightning:button if a lightning:inputField changes. This is the aura:component: <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:...