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
2answers
2k views

setCallback returning an ERROR state - lightning component

I'm trying to save a record (update) in salesforce, in a lightning component. I have a popup that retrieve the value of a record : Popup component : <aura:attribute name="newContact" type="...
2
votes
2answers
938 views

Re-Evaulating Selected-Rows in Lightning-Datatable When Data Changed

I've been stuck on this issue for a few hours now and don't seem to be getting any closer to resolving it. I currently have a Lightning-Datatable with pagination that renders 20 rows at a time. When ...
1
vote
0answers
21 views

Google Map full-screen control is not visible on chrome [closed]

I have implement a web page that include a google map component. In the map all other map controls(zoom, satellite, and etc.) are properly visible except the full screen control. The issue recreates ...
0
votes
0answers
45 views

LWC @track variable not causing rerender when it is reassigned from a refreshApex

My LWC code looks like: @api recordId; labels = { title, refresh }; @track showSpinner = true; @track checklists = []; dataForRefresh; @wire(getChecklists, {objectId: '$recordId'}) ...
0
votes
1answer
29 views

change the “end” attribute on an Aura:iteration using a button/javascript

I am trying to create a load more button that when clicked changes how many iterations are in an Aura:iteration. Right now the End attribute on that iteration is 10, and we would like it to change by ...
0
votes
1answer
33 views

Javascript: Validating fields in a field set

I am working with a Javascript button to validate fields before the button can update fields. Since there are over 20 fields to validate, (With the possibility of adding more) listing out each field ...
0
votes
2answers
1k views

Capture JS variable with AMPscript/SSJS

I have a script with moment js library running in a landing page and the purpose of the library is to check whether today falls in Daylight Saver. If it does then the function sends a true statement ...
0
votes
4answers
5k views

Making a command button open in new tab

How do I make this open in a new tab: <apex:pageBlockSection > <apex:commandButton value="...
0
votes
0answers
63 views

Lightning Web Component Scope

I have a event listener that is firing to handle the creation for new leads. Within the handler, I am calling a method to determine the source of the lead and identify the record type. However, one ...
0
votes
1answer
372 views

Avoid Auto Focus in Quick Actions

Quick action modals will automatically focus on their first element, but in other circumstances the same component won't auto focus. The following Examples do the same thing, but behave different: ...
1
vote
1answer
20 views

Javascript button to update record and load webpage

I can't understand why this Javascript button doesn't work. I keep getting an error: "Invalid or unexpected token" Can anyone see why this is? {!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")} var ...
0
votes
0answers
25 views

Event e.force:createRecord Auto-fill Attendees

I'm trying to auto-fill a new Event (standard Salesforce Event object) modal with Attendees for a component I'm making. I can't wrap my head around what I fill in to make this work. I was looking at ...
4
votes
1answer
750 views

async/await functions in LWC

Assume I have an LWC component and Apex Aura controller: /* AccountController.cls */ public with sharing class AccountController { @AuraEnabled public static List<Account> getAll() { ...
0
votes
1answer
732 views

Modal Pop-Up from Visualforce Page Included in Standard Detail Page Section

I have a Standard record detail page in which there are sections which include visualforce pages. I'm rewriting these using SLDS to look like lightning. From one VF page I'd like to open a modal which ...
0
votes
0answers
36 views

Creating of Maps and Setting the value based on key in lightning component

in JS, I need to create a map, like if my key=ABC,and 2 checkboxes were selected,map shoud contain,map="{key='ABC',value='2'}" and after if another key='xyz' and 4 chekboxes were selected,the map ...
0
votes
2answers
1k views

Opening in a new window from visualforce page opens a blank window?

I am trying to open standard page from a custom Visualforce Page through javascript using command button.But it reacts differently each time.It works properly sometimes.But in some cases it opens a ...
2
votes
1answer
601 views

JSON for Autocomplete functionality in VF

I'm trying to get my autocomplete functionality to work in my VF page for a TextField. I need to obtain the List of a custom Object from my controller (with the name and the ID of the record). I use ...
0
votes
0answers
11 views

Trying to use validation rule on managed button

I am in the process of creating a validation rule in a managed button. I noticed that the button is managed and from searching within the trailblazer community I've learned that I need to remove the ...
0
votes
1answer
761 views

apex:actionSupport with param is not passing updated value to controller

I have a VisualForce page that should pass the selected the value to the controller to update the record. See code below. <apex:inputField value="{!l2.Status__c}"> <apex:actionSupport event="...
0
votes
1answer
31 views

unrecognized base64 character apex

I converted a pdf file in base64 with javascript. function convertToBase64() { //Read File var selectedFile = document.getElementById("inputFile").files; var cvfiles = document....
0
votes
2answers
378 views

Creating a User Initiated Send definition in SSJS

I am trying to create a User Initiated Send definition in my Business Unit with the following code according to the wiki example: http://wiki.memberlandingpages.com/en/documentation/exacttarget/...
0
votes
2answers
1k views

lightning:input time display

I am using a <lightning:input type="time"/> component and the picker is displayed to the user in 12 hour time with an AM/PM picker. I want to display this value to the user in a table and the ...
1
vote
1answer
173 views

How to use AWS S3 JavaScript SDK with Lightning Web Components as 3rd party library

I am trying to initialize the AWS constant in my LWC component but always it is undefined. import { LightningElement, track } from 'lwc'; import { loadScript } from 'lightning/platformResourceLoader';...
0
votes
1answer
39 views

Prevent user clicking outside Custom lightning component

I have a parent custom Lightning Component which includes a custom lookup component inside, for Account Edit/Create. I want when the user starts typing (and results start to appear in a drop-down list)...
1
vote
1answer
721 views

How to pass values between two components

In a VF page, I have two i.e. A and B.In first component,there is a search box. Second component will display data type in first component search box. So How can I pass data between these two ...
0
votes
1answer
35 views

Javascript button should work in Lightning

I want to convert below code to Lightning Experience. Can anyone help me how to do that? {!REQUIRESCRIPT("/support/console/28.0/integration.js")} try { // if in the console if (sforce.console....
0
votes
1answer
56 views

Expose Visualforce instance url for making rest api call

I have started to make a chrome extension for salesforce. I got this link to start off with. https://github.com/mwelburn/Chrome-Extension-Force-SOQL-Popup This is a simple extension which queries the ...
0
votes
1answer
36 views

How to access custom object fields on function in Visualforce

Very new VisualForce and Apex user here. Currently working on a Visualforce page javascript function in which I'd like to update fields on a custom object based on certain conditions. Each custom ...
0
votes
1answer
638 views

DocuSign JavaScrip Button - Hard Code User /Contact

I am using DocuSign on quotes that should create an envelope and add Contact user (associated with Quote record) and a static user (or contact) 'John wilson'. Ie. Signer 1 should be contact on record ...
4
votes
1answer
919 views

ForceTK in a Chrome Extension - Cross-Domain Query Issue

I'm fiddling around with writing a Chrome Extension for Force.com and came across the following blog post (http://th3silverlining.com/2013/09/14/developing-chrome-extensions-for-salesforce/). I ...
0
votes
0answers
17 views

How to override meta tag in lightning custom community?

I want to override the property of the meta tag user-scalable=no I have tried to achieve it by adding same meta tag with different props in head markup feature but it only adds another tag in the ...
0
votes
0answers
29 views

Values not populating on the record

I have a lightning component that I'm calling on a quick action. It has a lookup field "Contact" which is prepopulated on the form. When I save the record, the contact value is not reflecting on the ...
1
vote
1answer
1k views

Clear Multi Picklist Value using JQuery

I want to clear multi picklist value when it is disabled. I'm using like this but it's not working. <apex:page standardController="Contact"> <script src="//ajax.googleapis.com/ajax/libs/...
0
votes
2answers
1k views

Lightning component quick action - redirect from Contact to User record detail page

I would like to know how to how redirect from Contact to related User record page via Lightning component quick action. Currently I have created Component which gets Contact record Id and passes it to ...
0
votes
1answer
50 views

Salesforce CPQ - Quote Calculator Plugin - How to access Account Name

I need to access Account Name from Quote Calculator Plugin. Sample code snippet is as below - export function onBeforeCalculate(quoteModel, lineModels) { alert(quoteModel.record["Account__r"]["Name"]...
0
votes
1answer
494 views

user profile in javascript without apex

How can we get user profile in lightning javascript component without writing Apex class? Please let me know
0
votes
1answer
43 views

Search while Type functionality on VFP not working as expected between apex:tab transition

I have 2 apex:tabs (Primary Tab, Secondary Tab) in visualforce page which shows a table of accounts list. I have a custom script for "search-while typing" functionality with below script. //VFP <...
0
votes
1answer
409 views

Partial Page refresh makes checkbox checked in visualforce Page

Here is my VF Page. function selectAllCheckboxes(obj,receivedInputID){ var inputCheckBox = document.getElementsByTagName("input"); alert(inputCheckBox); ...
2
votes
2answers
923 views

DatePicker Issue

I have two text field: One normal text field that accepts numbers. <apex:inputField value="{!FinancialAssCont.Down_Payment__c}" styleClass="form-control downpaymentAmount" onblur="...
0
votes
1answer
2k views

How to filter a list of records on clietndside based om checkbox criteria

I have tried using filters in a lightning component which filters records based on criteria. How can I toggle the filter based on true or false of a checkbox. The issue I have currently is when ik ...
0
votes
0answers
125 views

Parsing error: Expecting Unicode escape sequence \uXXXX in Salesforce Lightning

I have created a lightning component and I'm querying in the JavaScript controller. While I'm saving I'm getting the following error. Parsing error: Expecting Unicode escape sequence \uXXXX Orginial ...
0
votes
3answers
1k views

Action function not getting called during javascript execution

I have a command button which is calling a javascript function. In the javascript function, I am calling my action function. The control is entering the script but the actionfunction is not being ...
4
votes
2answers
88 views

Only fire function when user is done typing

There is this post that talks about how to fire a function once the user is done typing. How can this be implemented in an aura component? This is what I have so far, but it doesn't work. <aura:...
4
votes
2answers
4k views

How to debug Server-Side JavaScript Activity

I have created a server-side javascript activity as follows. I also have a automation created via automation studio which executes the server-side script. It is succeeding each time however I don't ...
1
vote
1answer
48 views

Apex is deselecting my radio buttons

Basically I want an apex method to run when a radio button has been selected. I also want the image used as the radio button to change. But it seems when the method runs the radio button is unselected ...
3
votes
1answer
130 views

Calling Apex method (to insert a record) imperatively from LWC JS

I want to insert a record (Log) whenever I open a record from a custom object. I want to know if it is possible to call an Apex method in LWC JS without @wire? I have a function in my Apex class to ...
1
vote
1answer
112 views

LWC - Object OpportunityLineItemSchedule is not supported in UI API

I've created a button on opportunity page using LWC. Once the button is clicked it should create OpportunityLineItemSchedule records based on Opportunity and related OpportunityLineItem record. ...
1
vote
4answers
1k views

Clicking button should reload the page and the callout must be performed asynchronously

My question is, should clicking a button reload a page and perform an asynchronous callout? It looks like its reloading the page after finishing the callout. Custom Button : Execute JavaScript {!...
0
votes
0answers
17 views

Full Calendar is not being displayed for specific users

We have used "FullCalendar"(JavaScript Event Calendar) in our Visualforce page. The calendar is being rendered in a Div. We are showing Event details through JSON. Recently we have updated the code in ...
0
votes
1answer
1k views

calling a javascript method to display a value on Output box by clicking apex command link

I am trying a scenario where on clicking a apex commandlink I need to capture a field's value and that value should be displayed on the same page in a seperate output text box or input text field. "...