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,003 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
345 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
85 views

sforce is not defined in UAT, but in sandbox yes

I'm having this problem, and I've tried all the solutions that can be found in this world to resolve; I'm working with the opencti APIs, in an aura component, in the sandbox the component runs fine (...
1
vote
0answers
18 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
62 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
317 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
39 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
2answers
6k 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
1answer
497 views

How to upload multiple files to ContentDocumentLink Object in one call from a lightning component?

I want to upload multiple files from a public site to salesforce ContentDocumentLink. How I can create bulk of files on javascript (client) side and handle them from apex? Lightning Component: ...
1
vote
3answers
1k views

error while trying to build a chart in lWC

I am trying to build a chart LWC using Chartjs javascript libraries. I keep getting error when I try to build the chart: C is not a function Below is my component Js : Import { LightningElement,...
1
vote
0answers
268 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
74 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
97 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
137 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
249 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
211 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
63 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
603 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
551 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
278 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
255 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
947 views

Refused to run the JavaScript URL because it violates the following Content Security Policy

I am using ringcentral salesforce integration when i click on (click to dial) it is not working. Refused to run the JavaScript URL because it violates the following Content Security Policy ...
1
vote
0answers
102 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
1answer
353 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
228 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
179 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
55 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
19 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
53 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
1k 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:...
1
vote
0answers
225 views

Unable to get clientHeight/clientWidth on an html element in lightning

I have a very simple thing here: <div class="slds-truncate"> <a id="popoverToggle" href="javascript:void(0);" data-value="{!v.recordId}" onclick="{!c.togglePopover}" style="position: ...
1
vote
1answer
909 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 ...
1
vote
1answer
510 views

FormAssembly Using JavaScript to fill in fields based on an Event Select change

can't seem to get the select change to update the location field based on the repeater location section. No errors it simply does not change the location(tfa_4) drop-down to equal the repeater ...
1
vote
1answer
143 views

How to consume window.parent.postMessage from a third party application in SFDC Canvas?

We are implementing SFDC and trying to integrate with a third party (different team within same organization) application using Canvas approach. This third party application is being currently used as ...
1
vote
0answers
31 views

Customizing Marketing Cloud Homepage UI to have message box pop-up when a user logs in - possible?

Is it possible to display a pop-up window or a message box, containing text and buttons to agree and disagree to the message, when a user signs into an account and loads the Marketing Cloud homepage? ...
1
vote
0answers
89 views

Voice to Text transfer in apex Visualforce Page

I have a requirement to convert voice to text for searching purpose. I am trying to have this below page in an iframe inside Visualforce page. It is working. Problem is that I need to modify the ...
1
vote
0answers
103 views

Unable to get screenshot of Rich Text Area Field which contains images using html2canvas library

Unable to get screenshot of Rich Text Area Field which contains images html2canvas Access to Image at xxx site from origin xxx site has been blocked by CORS policy: No 'Access-Control-Allow-...
1
vote
0answers
1k views

Re-render jQuerys FullCalendar?

I'm using FullCalendar on a Custom Object that shows each record in a calendar and I'm not entirely sure how I can make the calendar re-render depending on the ID I'm passing it. If I select a ...
1
vote
0answers
28 views

My req to add all input fields (created by picklist) value on total field by on blur event

Here in my code i am getting first field value only. <apex:page standardController="Entertainment__c" extensions="ScreenDetailController" sidebar="false" showHeader="false" docType="xhtml-1.0-...
1
vote
0answers
1k views

Handling Error Messages on submit of recordEditForm

I have recordEditForm in my component to create a new record. On submit of the form, the page lightning message shows "An error occurred while trying to update the record. Please try again." Then I ...
1
vote
0answers
234 views

How to programmatically identify that no modal is visible on screen?

I want to identify that screen does not have any modal visible, and based on this, I want to show or hide the window's default scrollbar. To show/hide the scrollbar I got excellent solution from this ...
1
vote
0answers
2k views

Multi Insert with recordEditForm

Is it possible to bulk insert a records using recordEditForm component?. Here's the sample lightning component which I tried: <lightning:recordEditForm aura:id="editFormAccount" objectApiName="...
1
vote
0answers
268 views

jsforce working on command line but not api

I am querying data from the data base from salesforce and it is working find with jsforce -l http://test.salesforce.com I then do a .register and a .authorize and then I can pull data from my ...
1
vote
0answers
43 views

Wish to prevent agent closing tab in service console

I am trying to find a way to stop agents from closing their tabs in service console if they have unsaved changes in tab. I am using sforce.console.setTabUnsavedChanges to accomplish this. I know i ...
1
vote
0answers
569 views

Issue using aura:unescapedHtml

I am trying to display some preformatted HTML data as rows in a table. If I copy the whole string from the controller and paste it into my component it renders correctly. But using aura:unescapedHtml ...
1
vote
0answers
74 views

Using jsPlumb library in lightning component

I'm trying to get jsPlumb to work inside a lightning component and I'm stuck in the beginning (https://jsplumbtoolkit.com/community/doc/home.html#container). When I try to initialize container, i get ...
1
vote
0answers
373 views

Server side Javascript in Marketing Cloud not updating data correctly

I am trying to update data in a data extension using a SSJS activity in automation studio. I've debugged the code in a browser and everything seems to be working correctly but when I run the activity, ...
1
vote
1answer
1k views

Infinite Scrolling in lightning:datatable combined with search filter functionality?

I got a lightning:datatable where I also have a search input field to search for whatever the user types in the input field. I can't get this to work together with an infinite scrolling table. Wonder ...
1
vote
0answers
325 views

How to make a tooltip pop out of it's container

I'd like my tooltip to pop out of it's container, but unfortunately it gets clipped off. Any suggestions about styling that would give me my desired result: My actual result: My code: var ...
1
vote
0answers
91 views

Reflected XSS issue in Salesforce Visualforce Page

I'm facing Reflected XSS issues for the below 2 lines in Visualforce Page . I have tried by keeping JSENCODE/URLENCODE to fix the issue but functionlity is breaking . Could anyone suggest for the ...

1
3 4
5
6 7
21