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
1
vote
1answer
12 views

Setting Style through JS

I would like to know if this method exist in JS JS this.template.querySelector(".month").display='none'; HTML <h3>Month</h3> <lightning-input name="Month" label="...
0
votes
0answers
11 views

Can't focus an element on visualforce page reload (as a result of action)

We use apex:actionSupport in visualforce page, actionSupport's action returns null. We want this page's focus not to change after reloading. What should I do? Users open Visualforce page from ...
1
vote
1answer
385 views

How can I lookup/filter rows in exacttarget with a date field in the future?

Date filtering seems to either be difficult in Exact Target or just poorly documented. I'm trying to filter to only show future items. Given a data extension SomeExtension with a Date field called ...
0
votes
1answer
19 views

how to handle list of list in salesforce lightning

how can I handle list<list<string>> in lightning. I am getting list<list<string>> from the apex and I want to pass it another method again to the server.
1
vote
2answers
35 views

Call public method in multiple child lightning web components

I have created multiple instances of child component in parent component using iteration. <template for:each={vohmObjectList} for:item="vohmobject" for:index="index"> <div key={vohmobject....
1
vote
1answer
53 views

event.getSource() alternative in LWC? (considering origin reparenting)

Consider below component chain in Aura: <c:parent> <c:child> <c:grandChild> When grandChild fires event, we can get hold of the source component by using event....
4
votes
3answers
2k views

Uncaught Assertion Failed!: Descriptor for Config required for registration : undefined Callback failed

I am receiving this error: Uncaught Assertion Failed!: Descriptor for Config required for registration : undefined Callback failed: apex://AccConListController/ACTION$getAccounts This error ...
0
votes
0answers
19 views

How to use Path Celebrations Feature in Lightning web Components?

I am just wondering, if we can use this below feature in custom lightning web components? https://admin.salesforce.com/build-user-engagement-with-path-celebration
4
votes
1answer
356 views

Stripe integration for Salesforce in lightning components

We are trying to implement Stripe integration with Salesforce by using Lightning Components for payments. Stripe use an API for securely obtain the users card information. This API is for the client,...
0
votes
1answer
32 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
26 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
34 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
15 views

Uncaught SyntaxError: Unexpected Identifier [on hold]

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
18 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
32 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
352 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
173 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
21 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
11 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
35 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
41 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
108 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
97 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
895 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
417 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
38 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
16 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
383 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
33 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
29 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
450 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 ...