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
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
606 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
165 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
105 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
27 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
2answers
608 views

Regex on lightning:datatable

I'm using lightning:datatable to display the Account object in a table. I've also added a regex that lets users search for any field in any column. What I wish to do is, if there are no matches, ...
1
vote
0answers
71 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
84 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
830 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
25 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
1answer
252 views

Show modal on top of Component rather that page

I have a component created : <aura:component description="CaseRelatedArticleComponent_ACE" implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId" ...
1
vote
0answers
811 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
175 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
1k 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
218 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
35 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
431 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
61 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
313 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
0answers
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
266 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
81 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
vote
0answers
48 views

How to get chatButton Language using LiveAgent Javascript api

I am trying to access chat Button language using LiveAgent javascript api. Any ideas as to how i can do that Or if i can use SOQL query to get that information.
1
vote
0answers
23 views

Custom Profile Center POST Subscriber to List

I'm looking for a starting point on how to POST a subscriber to a list so that they are able to opt-in to a list from which I grab from Marketing Cloud. I am using SSJS to grab all of the lists that I ...
1
vote
0answers
163 views

Canvas in visualforce page is not capturing data when used in touch screen devices

I have a requirement to capture user's signature using <canvas> and save it to a record. It is working with mouse but not when using touch screen devices like mobile phones. Below is my code: &...
1
vote
0answers
41 views

how to add a selected row value from child to parent?

parent controller public String name {get; set;} public String phone {get; set;} public String email {get; set;} private List<Contact> contactList; public void addMore() { string nameT = ...
1
vote
0answers
264 views

Modal Dialog Rendered by Handlebars — Broken by <apex:form> tags

I'm attempting to create a pop-up form in a visualforce page. The pop-up form is a modal dialog that appears when a button is clicked. The form is templated using Handlebars, and has some input fields ...
1
vote
0answers
114 views

How to Set options dynamically ui:inputSelect created by CreateComponent

I have created ui:inputSelect using CreateComponent method. I have set onchange event on that inputSelect. onchange of an controlling field I have to set options for another inputSelect(dependent ...
1
vote
0answers
123 views

Refresh tab is not working

I have custom console application with my own VF page. Once I clicked the Refresh Tab, the tab is been selected (focusedTabChanged event is been called) but the tab is not refreshed. Maybe I need to ...
1
vote
0answers
66 views

Variables won't pass from server-side javascript onto Microsite

I'm trying to get variables on a microsite to pass from the form page to the thank you page. Passing the variables works, and loading them into a data extension, but getting them to also display ...
1
vote
0answers
203 views

inputCurrency format changes on focus

I have an inputCurrency field defined like this: <ui:inputCurrency aura:id="amount" class="slds-p-top_none" value="{!s.Amount__c}"/> This input is inside a component that lives inside an ...
1
vote
0answers
112 views

URL parameter not updating when using apex params

We have a Lightning component hosted inside a Visualforce page to select multiple insurance carriers. When you enter the member ID for a carrier, it fires a Lightning event that is handled by the ...
1
vote
0answers
221 views

Live Agent javascript api not working with omni channel routing

We have a LiveAgent integration and were using the event function 'sforce.console.chat.onChatStarted' to get details about the chat that agent had accepted and 'sforce.console.chat.onNewMessage' ...
1
vote
1answer
25 views

Control 3 elements with different ids with a single checkbox in visualforce page

I have a visualforce page wherein I have to control two input boxes and one picklist field with a single checkbox. The idea is that input boxes must be both disabled when checkbox is selected, while ...
1
vote
0answers
451 views

SetUserInfo for Collect Tracking Code from subscriber level data pulled from appended URL

I am attempting to define the user info inside the js needed to SetUserInfo for the Collect Tracking Code implementation. <script type="text/javascript"> _etmc.push(["setOrgId", "MID"]); _etmc....
1
vote
0answers
159 views

Remove quick action box

I have a lightning component and have it set as a quick action. However, I do not want the quick action box to appear. I want a button placed where the other quick action buttons are hence why I ...
1
vote
0answers
59 views

Add a field to the Find Duplicates search

I'm re-creating our Find Duplicates button on the lead object, and was wondering if there's a way to add an additional field to this search (beyond Name, Last Name, Company, Email, Email Domain, and ...
1
vote
0answers
313 views

Pass list of selected SObject records to Remoteaction method

I have below code where I am trying to pass a List of Accounts to Remoteaction method from a VF Page. I am able to pass one as below, but can't figure out for a list of Accounts. Can someone please ...
1
vote
1answer
110 views

Fetch JavaScript code of managed package button

I have a managed package object which has a button called Public Link which executes Javascript and displays a public URL in an iframe. Is it possible to see the javascript function code and save the ...
1
vote
0answers
51 views

Setting up Mocha to unit test visualforce page javascript?

I am interested in using a framework like Mocha to test my visualforce page, which is heavily JavaScript. However, the setup examples I see in the documentation seem to be for more testing your local ...
1
vote
1answer
61 views

Invalid name for salesforce subtab

On trying to override an existing subtab on click of a button in vf page, I am getting invalid name for subtab error. var stabid = ''; function edit(){ sforce.console.getEnclosingPrimaryTabId(...
1
vote
0answers
24 views

How to submit parameter to a quick action?

i have a quick action with two fields. I want to submit a parameter for one field. How can i do this? I have already specified a prefdefined field value and a button on a custom vf-page. var ...
1
vote
1answer
38 views

How to pass var to callback?

a today, i´m learning lightning, and i block with asyncronous callback. To practice, i did a small helper with apex call and a callback, but when a update a var out of callback, the value in callback ...
1
vote
0answers
533 views

Lightning clientwidth of component when resize

I have problem with geting width of component - I run resizer and try consol log with width of lightning button. component.set('v.resizeCallback', $A.getCallback(function(){ if(component....
1
vote
0answers
888 views

“sforce.one.navigateToURL” does not navigate to Lightning Component

I have got a special problem using the "sforce.one.navigateToURL" command in a visualforce page. I am using the following code snippet to redirect a user from a visualforce Page to a Lightning ...
1
vote
0answers
188 views

How to retrieve Object name from Push topic API streaming

I created a pushTopic for an object pushTopic.Name = 'InvoiceStatementUpdates'; pushTopic.Query = 'SELECT Id, Name, Status__c, Description__c FROM Invoice_Statement__c'; From Salesforce Java ...
1
vote
0answers
551 views

Blur everything on init

Loading a lightning component automatically focuses the first input element. Lightning won't let me manipulate the DOM so this javascript solution won't work document.activeElement.blur(). This ...
1
vote
0answers
202 views

Calling method of subclass of super class (Apx) from a javascript line in lightning component

public virtual class TopLevel { @AuraEnabled public virtual void getwriter() { System.debug('At top level'); } public class lowerLevel extends TopLevel { @...
1
vote
0answers
113 views

Error loading Paypal Expresscheckout javascript

I am trying to integrate paypal express checkout into my lightning community website. I included the following line in my lightning component to load the javascript <ltng:require scripts="https://...