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
2answers
17 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
164 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
16 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
9 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
15 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
33 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
3answers
36 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
32 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
89 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
877 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
15 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 ...
-1
votes
0answers
26 views

Expand list with see more link

<aura:iteration items="{!v.Accounts}" var="acc"> {!acc.description} </aura:iteration> How do I restrict number of lines displayed for each field value with a "read more" link?
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
34 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
14 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
22 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
43 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
448 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
409 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
128 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
542 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
160 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 ...
1
vote
3answers
398 views

Document.getElementId() not working for some div's in Salesforce Summer'16 release

Since Summer'16 release, I have been getting many issues in Lightning components, resolving them by moving all my JQuery to Vanilla JavaScript. Currently, I am getting an error in Vanilla JS while ...
0
votes
1answer
393 views

System Error - Adding Records on lightning component

I have a lightning component to create contact record and list of child records. On click of add button, contact is getting created and when it is calling the next method to create child record i get ...
0
votes
1answer
803 views

Submitting web-to-leads with AJAX instead of embedded form

I am attempting to make my SalesForce form work with a redesigned form using AJAX instead of a simple jQuery submit function. I don't understand what I am doing wrong. Right now after submitting the ...
0
votes
1answer
385 views

Javascript in place of apex:page action - JS remoting

I want to know if I can use javascript in place of apex:page action. I am implementing js remoting in my vf page. I am going to add @remoteaction before my pagereference method in controller. I also ...
-2
votes
0answers
23 views

standard recordtype url in custom button [closed]

I have a rquirement that, by clickin on a custom button on Contract object  standard recordtypes like OP1,OP2,OP3 page selection should be opened. If we select OP1 recordtype from that picklist  ...
0
votes
1answer
27 views

How to prefill Case record with contact ID and Account ID from VF page using Live agent prechat form?

I have a VF Page Where community User (for example this user will have 3 contacts and 3 accounts, but only only for one contact community is enabled) will choose Account from drop-down list, based on ...