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
0answers
12 views

HELP to convert onclick javascript to visualforce page in lightning

{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/14.0/apex.js")} var win = window.open('/apex/xxxx?id={!Bb__c.Id}&retURL=/apex/ForceWindowClose', 'Popup Name' ,"...
0
votes
1answer
17 views

I want to display two different sucess message for two button in single lightning component

I have two button in same class one is Clone button,another is Renew button,now it is displaying only one sucess message for both button,but i want to display two different success message for two ...
2
votes
1answer
29 views

Display row selection per LWC datatable

I'm creating LWC datatables on the fly, dynamically through a REST API. If I have one table, everything I'm trying to do makes perfect sense. However, since I'm creating everything dynamically, the ...
0
votes
1answer
14 views

Convert Javascript button to Lightning Action

I have to convert many javascript buttons into Lightning Action to open VF Page. Below is an example of a button on the Account record page. if( (accStatus != "Active" && accStatus != "...
0
votes
3answers
48 views

Populate radio button options dynamically

I am trying to set a radio button's options dynamically. I'm first constructing a wrapper list in my first component and passing the list to another component where I'm displaying the values. Apex ...
1
vote
1answer
18 views

How to assign aura:attribute for objects with default value null?

This must be a a very simple question, but may be I'm doing it wrong. I wanted to set default aura:attribute value to null on lightning component as below. e.g. <aura:attribute name="selectedObj"...
1
vote
1answer
23 views

Can I call a System namespace method from LWC?

I want to be able to call the System.Site.getType() method from an LWC JavaScript file. I thought this would work: import sitegettype from '@salesforce/apex/System.Site.getType'; But it gets error, ...
0
votes
0answers
26 views

Creating a hidden attribute for a web compnent that hides from DOM as well

I have created a component named <my-customobject>. Inside the component there is <my-customfield> component. <template if:true={showCustomObject}> <my-customobject> ...
0
votes
1answer
24 views

Update SQL Query Text via SSJS

I have written some simple code which i will try to loop later but I am getting no success in trying to use SSJS to update SQL queries. I don't need to perform the actual query i just need to update ...
0
votes
0answers
11 views

Connected app components randomly not loading

Connected app components are not displaying in our customers' orgs. Randomly the components are not loaded into their respective divs. Roughly 95% of the time they AREN'T loaded. If we disable cache ...
0
votes
0answers
26 views

Disable/Enable a commandbutton in VF using a function

I know that are a lot of messages regarding this issue, but cannot find the similarity into the problem I am facing. I have created a VF page - and into that VF page I have got a command button with ...
0
votes
0answers
12 views

Apex:commandButton onclick funtion not getting called after window.onload

I am facing issue with the apex:commandButton in my visualforce page. The requirement is simple : I need to check a condition and based on that I will open/close a div. That div contains a message and ...
-1
votes
0answers
38 views

Generating pdf from lightning web component content [closed]

I want to generate PDF from lightning web component content.I have an application developed in LWC. It contains 2 pages.On second page , on click of button, I need to wrap the content from both pages ...
0
votes
0answers
17 views

Upgraded visualforce page api version and breaks page functionality

I raised the api version of a visualforce page from 24 to 47. Now previously functionality is no longer working as expected. When I click the openLookUp() button the new window no longer opens up I ...
0
votes
1answer
33 views

Parsing data JS or Apex Controller [closed]

Is there a performance cost if we do business logic on the client JS side vs Apex server side ? Let's say i have an Apex controller and a lightning component. on Page load, the JS controller is ...
0
votes
0answers
11 views

On button click open the chat window for Salesforce customer chat support

My question is similar to the question asked here The answer is given there kind of resolve the issue, but that answer is in jQuery and I converted it to javascript but it's not working JQUERY: $("...
0
votes
1answer
24 views

Creating a count up timer using Javascript in VisualForce page that doesn't reset when it refreshes?

I am trying to create a timer that counts up whenever a record populates the VisualForce page using Javascript, however, whenever the page refreshes the timer resets as well. This is a problem because ...
2
votes
1answer
41 views

LWC Datatable any possible way to remove 'select all' checkbox?

So the datatable does ALMOST everything I need for my component, very handy. But I only want one selection of a row at a time. I want users to have to actually click each row if they want to select a ...
2
votes
1answer
114 views

div innerHTML with standard lightning web components

I'm trying to display a custom format for my lightning web component via rendered and innerHTML of a div. <template> <div class="container" lwc:dom="manual"></div> </template&...
1
vote
1answer
54 views

Best way to use Jquery on Lighting Web components

I want to build a lightning web component which involves the use of jquery and bootstrap. The Lighting Web Component involves multiple child components. I was going through the salesforce document on ...
0
votes
0answers
38 views

how can i assign date from html input tag to <apex:inputhidden>?

How can I store date from HTML input tag to salesforce ???? Please help me I am struggling form 3 days... this is Html input field: <b> <tr class="date-picker--wrapper"> ...
0
votes
0answers
14 views

Fullpage snap-in scroll in lightning component using fullpage.js

Would like to ask if anyone of you had implemented this full page scroll external library in lightning components? Here's the link that I want to mimic. https://alvarotrigo.com/fullPage/examples/...
0
votes
0answers
50 views

Using RxJs with LWC in Salesforce

I want to use RxJs in my LWC. I was successfully able to import RxJs version 5. However, how can I use it with LoadScript. This is my code, it is giving me the following error "of is not a function at ...
0
votes
1answer
38 views

How to access the contents of a SecureNodeList in Lightning Components

I am currently trying to access a SecureNodeList, but I keep running into errors. Before I go into depth more, I will explain what I am trying to do first, before I end up with an X-Y Problem. My aim ...
4
votes
2answers
110 views

Accessing JSON fields in html of LWC

I am calling an external system from an @wire method and it returns a json string. When I parse the json into an object I am able to use dot notation to access fields from the json object in JS but ...
0
votes
0answers
19 views

How to break an iFrame in SFDC

So i'll give you an outline of what i'm dealing with. we have a VisualForce Page displayed on a standard page layout, and then we view it in lightning UI. Now all this VF page does is passed an Id ...
0
votes
1answer
28 views

Lightning Event not firing in Component

I am working through the Aura components trailhead but am running into an issue where the component event is not firing. Here is my code: CampingList cmp <aura:component controller = '...
0
votes
0answers
28 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
28 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
0answers
28 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
23 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
0answers
24 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 ...
-3
votes
0answers
19 views

How to process multi-select records using lightning component? [closed]

Hi All, How to display selected records in the related list section. I can able to processed records but values are not visible.Please anyone help me Component Page : <aura:component ...
1
vote
1answer
18 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 ...
4
votes
1answer
229 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() { ...
1
vote
0answers
18 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
32 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
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
23 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....
1
vote
1answer
73 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
37 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)...
0
votes
1answer
35 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
54 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
0answers
14 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 ...
0
votes
0answers
58 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
1answer
34 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 <...
2
votes
1answer
44 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 ...
4
votes
2answers
68 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:...
0
votes
0answers
15 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 ...