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.

Filter by
Sorted by
Tagged with
0
votes
1answer
25 views

Search & Column Sorting with SLDS Data Tables

I am trying to make a basic, external app with the Salesforce look-and-feel using Salesforce Lightning Design System (SLDS). Notably, the app includes data tables so I want to use the Data Table ...
0
votes
0answers
8 views

Is it possible to pass the name of the Quick action button that initialized the lightning component? [duplicate]

IE i have a request for a classic to lightning conversion. There's two buttons that exist that pass parameters to a new record creation page (modal in lightning). One button creates a opp of ...
-1
votes
1answer
44 views

Validating input and throwing error

So I have this field input in my UI, I need it to throw an error if it is left blank, but it is not. This is my code <div class="slds-text-heading_medium slds-align_absolute-center"> &...
2
votes
1answer
23 views

Accessing {!$Organization.IsSandbox} in Visualforce?

So in visualforce I can access all kinds of organization variables like: '{!$Organization.Name}' '{!$Organization.City}' '{!$Organization.Country}' '{!$Organization.Id}' etc... Now what I need is ...
0
votes
1answer
30 views

Script Error in LWC

I'm trying to set values depending on the chosen variable of lightning-combobox so i created the following javascript get timing() { return [ { label: 'Weekly', value:'weely' }, ...
0
votes
1answer
14 views

Uncaught SyntaxError: Unexpected Identifier

I have the following problem. I'm trying run the code from deck.gl for Geojson polygon(https://github.com/uber/deck.gl/tree/7.1-release/examples/website/geojson). And I'm getting the following error ...
0
votes
0answers
17 views

focus() on lightning:input does not work in console (with record-edit-form)

This is kind of show stopper for business. Use case: We have to load a custom form with prepopulated values in certain fields, then do some processing on load of form and finally set the focus on ...
0
votes
2answers
30 views

Injecting <script> into head via Lightning component

I'm trying to add a Qualtrics survey pop-up on a specific page in a Lightning community. Adding the JavaScript <script> to the community <head> runs it on every page, so I created a ...
0
votes
1answer
350 views

How to sum values in pageblock table

I try to get sum of values in a column to use it in controller. Vf Page: <apex:page showHeader="true" sidebar="true" controller="PNLSplitController" doctype="html-5.0" action="{!onloadmethod}">...
3
votes
3answers
170 views

LWC mass delete records using deleteRecord from lightning/uiRecordApi

I am using deleteRecord adapter from lightning/uiRecordApi. It works fine when I give it a record Id, but a would like to give it a list of records id to delete all of them at once. What I have done ...
0
votes
1answer
19 views

Setting variables depending on options

I'm trying to set variables depending on options using <lightning-combobox> but I'm getting a deploy failure. The code I m trying is the following JS get timing() { return [ ...
0
votes
1answer
10 views

How to invoke Lightning Controller method when Flow Next/Finish button is pressed

I have a Flow with a custom Lightning component which implements lightning:availableForFlowScreens. I want the Flow to invoke a client-side javascript controller method when the user uses the Finish ...
0
votes
1answer
16 views

Hot to make a dynamic lightning:inputfield required

I have a fieldset which I get from serverside and load on clientside I am adding the required parameter to the field but my component does not alert on required. I added the values behind the fields ...
0
votes
2answers
34 views

How to reload custom lightning component in a lightning page tab every time I click on the tab?

I have one lightning component named "Add/Edit Invoice Line Item" (as seen on screenshot) I want to reload this component every time a user clicks on this tab. Is there any way or event which can be ...
0
votes
2answers
39 views

“Cannot read property 'setCallback' of undefined” in “window.setTimeout”

I'm trying to call a function every 10 seconds. But I'm getting this error: Uncaught Error in $A.getCallback() [Cannot read property 'setCallback' of undefined]. What is wrong? doGet : function(...
0
votes
1answer
26 views

How to add two buttons under one column Lightning Datatable

Is there a way to have two buttons in one column using lightning Datatable? Would like to join the "Delete" and "Edit" buttons under the "Action" column. Controller.js ({ fetchAccounts : ...
0
votes
1answer
40 views

How to overcome 2500 SSJS limit to delete more than 2500 DE records at once?

I created a SSJS script to delete certain records from a DE which seems to work fine for less than 2500 records. But once the number of records that need to be deleted surpass 2500 records, then it ...
0
votes
0answers
10 views

How to send an email on custom button click? [JavaScript not working]

I am trying to send an email (from Classic Email Template) on button click with validation and field update. But when I click the button, it does nothing. Can you please help me what's wrong? {!...
0
votes
1answer
106 views

salesforce lightning $A.get(“e.force:createRecord”) return empty

I tried component to open the new contact page. Complete reference code var createAcountContactEvent = $A.get("e.force:createRecord"); createAcountContactEvent.setParams({ "entityApiName": "...
1
vote
3answers
94 views

Callback function in LWC

I have 2 picklist(Combo-box). On change of value in the 1st combobox - depending on the value returned from the controller - i need to render or hide the 2nd combobox. I'm using refreshapex to get the ...
1
vote
1answer
887 views

Error in $A.getCallback() [Cannot read property 'fire' of undefined] failed: $A.get('e.force:refreshView').fire();

Background I have a Visualforce page which loads a Lightning Aura Component using LightningOut. When the Lightning component executes this line: $A.get('e.force:refreshView').fire(); I get this ...
1
vote
1answer
405 views

Issue in console event listener

I have recently enabled omnichannel in our org. I need to perform some action when an agent accepts a post from the omnichannel widget in the console. To do this I added a hidden custom console ...
0
votes
1answer
18 views

Lightning e.force:createRecord won't take RecordTypeId

I'm trying to make a simple component for my home page which creates a record with a specific record type. Every time I try it, it uses the default record type instead of the intended. I've made a lot ...
0
votes
1answer
416 views

How to display Public groups in drop down list in visualforce page?

How to display Public groups in drop down list and in this list select one public group,then search button clicks need to display the users in particular public group? anybody help me......
0
votes
0answers
36 views

How to pass variable to input in apex repeat using jquery/javascript [on hold]

I have two table Table A & Table B. Table column x value should display on Table B as a input value. Both Table A and Table B are in repeat. I can able to show as a output value but i cannot able ...
2
votes
1answer
35 views

Details for function Script.Util.HttpRequest

Can someone give me more details of the function Script.Util.HttpRequest mentioned on the site: https://developer.salesforce.com/docs/atlas.en-us.mc-programmatic-content.meta/mc-programmatic-...
-2
votes
0answers
15 views

How to pass parameters for static resource

I have JavaScript for date auto format. Below is the code. This will auto format the date. In this JavaScript I am getting the Id of the date field like document.getElementById('Registration:form1:...
0
votes
0answers
23 views

How to place a input file in a text area and replace it with a attach icon?

<div class="slds-form-element"> <label class="slds-form-element__label" for="text-input-id-1">Input Label</label> <div class="slds-form-element__control slds-input-has-icon slds-...
1
vote
1answer
382 views

Using Custom Compact layout on Visualforce Page

I have a visual force page displaying lots of information in a report of sorts. To enchance the user experience I have added some code to load the standard compact layout for records to provide some ...
0
votes
2answers
32 views

Lightning Combobox using elements from an apex class

I have the following functions Apex public class SchedulableClasses { @AuraEnabled(cacheable=true) public static List<ApexClass> SchedulableClasses(){ ApexClass[] ...
0
votes
0answers
18 views

How to identify if the custom button on opportunity was clicked by the opportunity owner

I have this requirement where I need to check if a custom button is clicked by either the opportunity owner or the product owner (Products that are selected for the opportunity). I am calling a ...
0
votes
1answer
27 views

How to a adress lightning button from parent component

I have a master lightning-component with a next button and a child component button with create. I want to a replace the create button from the child with the next button from the parent. I get the ...
1
vote
1answer
403 views

Rerender does not work with Modal

I have a VF page which gets the folder name from the user and creates a folder in one library. The page has a button & the folders existing the library is shown using a repeater. when the button ...
0
votes
1answer
24 views

Visualforce jQuery Works when Hardcoding the Value, but Doesn't Properly Run Within Function

I want to pull the styling (width) of one pageBlockTable and apply it to another pageBlockTable dynamically with jQuery - however I'm not sure why this isn't working... This code runs without any ...
0
votes
1answer
44 views

@API for text variables [closed]

I'm trying to associated lightning input values to be used as variables JS import { LightningElement,wire, api} from 'lwc'; import getClass from "@salesforce/apex/SchedulableClasses....
1
vote
1answer
33 views

Onclick event for an apex action

I'm trying to create an onclick to execute an apex action import { LightningElement,wire} from 'lwc'; import getClass from "@salesforce/apex/SchedulableClasses.SchedulableClasses"; import setPlan ...
0
votes
1answer
16 views

Iterating through a VisualForce page to manipulate CSS using document.getElementByClassName(“foo”)

I am adding CSS classes to numerous <apex:inputFields>, that i am passing to the HTML <input> element using html-class="foo". Then i am iterating through them like this to change other ...
0
votes
0answers
10 views

sforce.console.getFocusedPrimaryTabId returns undefined value

sforce.console.getFocusedPrimaryTabId returns 'undefined' value. I am using the function in a Javascript button on Lead object to open a sub tab if the button is clicked in console. if(typeof (srcUp)...
1
vote
2answers
449 views

Web to Lead, Date showing in Debug page, but not in the Lead

My contact for is using 2 date pickets, Check-in/Check-out dates. When I fill out the form the dates show fine in the debug page. I receive and email with a link to view the lead and the dates are ...
1
vote
1answer
410 views

Invoking another component in lightning salesforce

In my lightning component, calling a method on onclick event and in turn which calls an another component. which works fine but whenever the page is refreshed it fails to call the component on First ...
0
votes
1answer
18 views

Inject javascript in standerd lightning detail page

I had created a custom lightning component to send email(customized based on requirement) and I added the component in page. But my component is not loaded when page is loaded instead of it is ...
0
votes
1answer
36 views

Zoomable image on Lighnting Component

I need to implement dynamic zoom or a "Magnifying Glass" on an image on Lightning Component(Community). Example: https://sularome.github.io/Zoomple/ I have searched many sites and tried to implement ...
2
votes
1answer
23 views

Javascript Controller to Apex Controller naming syntax error

I am getting an odd bug where capitalizing the first letter of an Apex method that returns a map, causes an error within the javascript controller. Javascript: var action = component.get("c....
0
votes
0answers
16 views

How to keep old file when click on cancel or choosing wrong file format using <apex:inputFile?

So I have a input file in my visualforce page. The conditions that I have on the file are them not being more than 10MB and of type doc, docx or pdf. The issue I'm facing is that I lose the file ...
0
votes
0answers
130 views

Jquery UI draggable

I am trying to implement Full Calendar external events drop in my LWC. There is an amazing example adding FC to SF LWC here: https://github.com/Gurenax/sfdx-lwc-fullcalendarjs What i am trying to do ...
0
votes
2answers
25 views

SSJS Activity of automation - Split String using javascript

I am trying to split string variable in ssjs script but my automation always turns into error below is my code to split the string: var str = '<CreatedDate>2018-10-24T04:31:00</CreatedDate&...
0
votes
1answer
543 views

How can I get my visualforce component to refresh/be recreated after button click?

I have a Visualforce component that was a Visualforce page, but altered to be a component so that it could be added to a popup on another page. The popup works fine, however I cannot get it to '...
6
votes
3answers
12k views

How can I quickly get today's date in a Lightning Component? (for use in an attribute)

In Visualforce, we could merge {!TODAY()} directly in the markup. What is the equivalent in a Lightning Component?
0
votes
2answers
163 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
votes
1answer
36 views

I need to fetch the currently logged in user id, username, email firstname, lastname from SFDC using the Javascript function [closed]

I need to fetch the currently logged in user id, username, email, first name, last name from SFDC using the JavaScript function. I have VF page created on which I wrote a script tag, in which I need ...